Live data from Hacker News

C Minus Minus

en.wikipedia.org

41–50 of 75 posts

Re: C Minus Minus

#41
post #23

I asked this on Ask HN sometime back but did not get a lot of responses. So asking it here because it might be of interest to people reading and commenting on this artile here. Which programming language other than C is available for most platforms? It is well known that some C compiler implementation is available for almost every computable platform. I am looking for another programming language that has compiler im…

Free Pascal[0] supports a wide range of platforms and architectures. From the site:

> Free Pascal is a mature, versatile, open source Pascal compiler. It can target many processor architectures: Intel x86 (16 and 32 bit), AMD64/x86-64, PowerPC, PowerPC64, SPARC, SPARC64, ARM, AArch64, MIPS, Motorola 68k, AVR, and the JVM. Supported operating systems include Windows (16/32/64 bit, CE, and native NT), Linux, Mac OS X/iOS/iPhoneSimulator/Darwin, FreeBSD and other BSD flavors, DOS (16 bit, or 32 bit DPMI), OS/2, AIX, Android, Haiku, Nintendo GBA/DS/Wii, AmigaOS, MorphOS, AROS, Atari TOS, and various embedded platforms. Additionally, support for RISC-V (32/64), Xtensa, and Z80 architectures, and for the LLVM compiler infrastructure is available in the development version. Additionally, the Free Pascal team maintains a transpiler for pascal to Javascript called pas2js.

[0] https://www.freepascal.org/

Re: C Minus Minus

#42
post #23

I asked this on Ask HN sometime back but did not get a lot of responses. So asking it here because it might be of interest to people reading and commenting on this artile here. Which programming language other than C is available for most platforms? It is well known that some C compiler implementation is available for almost every computable platform. I am looking for another programming language that has compiler im…

Two very different answers for you. 1: Forth. I've seen Forth on things that I didn't even realize were computers. Since an interpreter can run in a few hundred bytes of ROM, that's not too surprising. 2: Rust. Rust can run on 8/16 bit micros, client side web (WASM), and on iOS, along with all of the more conventional and easier targets. Probably the only popular universal language for 2022 targets, although there ar…

[flagged]

Re: C Minus Minus

#43

Earlier quoted context omitted.

> Which programming language other than C is available for most platforms? There is almost no platform java can't run on. Rust is a bit esoteric, but it can run anywhere you have a working libc.

> Rust is a bit esoteric, but it can run anywhere you have a working libc. I don’t think that’s true. Doesn’t Rust only run on platforms that LLVM supports?

I'm wrong, but you're also incorrect. Turns out, that rust can in theory run anywhere you have a libc, but if the target isn't known to the compiler yet, it's on you to connect libc to the rust STD.

Re: C Minus Minus

#44

Earlier quoted context omitted.

Modern architectures have different register banks for the two, but that's irrelevant, C-- is not register-centric.

The backend can of course try to guess what type of register data should live in, but it's not always going to make the right decisions if it doesn't have type information to work with.

Type information is not what conveys that information, it's the operations used on the data that matters.

Re: C Minus Minus

#45

Earlier quoted context omitted.

> Which programming language other than C is available for most platforms? There is almost no platform java can't run on. Rust is a bit esoteric, but it can run anywhere you have a working libc.

Java requires a certain amount of memory and CPU power (if nothing else because it's a garbage collected language). I doubt Java is available on some of the smallest computers C can run on, like many microcontrollers or legacy platforms.

There is https://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition

But of course, a 32KB RAM minimum would be too much for some legacy systems. Still, Java is actually far more flexible than most people would think.

(Also, at its heart the JVM is just a Forth-like stack based interpreter, and I would guess that loading and parsing a .class file is more complicated than the interpreter itself!)

Re: C Minus Minus

#46
post #20

From an engineering point of view, it’s interesting they chose to implement their own intermediate language, as opposed to just sticking to LLVM IR and “outsourcing” the problem of code generation. I actually researched this some time ago, and was a bit surprised to learn that modern GHC’s intermediate representation seems to differ from what the C-- paper describes quite substantially, in ways that are only describe…

GHC has supported both Cmm and LLVM as backends for a while:

https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_gui...

Re: C Minus Minus

#47
C—- was the joking name for the subset of C we had to implement for my Compilers course in college (1990s, UCSC). I’ve assumed that other courses at other colleges did this, too.

When I clicked on the link this is what I expected the article to be about.

Re: C Minus Minus

#48
post #46
post #20

From an engineering point of view, it’s interesting they chose to implement their own intermediate language, as opposed to just sticking to LLVM IR and “outsourcing” the problem of code generation. I actually researched this some time ago, and was a bit surprised to learn that modern GHC’s intermediate representation seems to differ from what the C-- paper describes quite substantially, in ways that are only describe…

GHC has supported both Cmm and LLVM as backends for a while: https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_gui...

And relevantly, people were clamoring for a non-LLVM AArch64 backend due to how slow LLVM is at codegen by comparison...

Re: C Minus Minus

#49

Earlier quoted context omitted.

> Which programming language other than C is available for most platforms? There is almost no platform java can't run on. Rust is a bit esoteric, but it can run anywhere you have a working libc.

Java requires a certain amount of memory and CPU power (if nothing else because it's a garbage collected language). I doubt Java is available on some of the smallest computers C can run on, like many microcontrollers or legacy platforms.

Smart Cards?

Full C is also not available everywhere, specially 8 bit and 16 bit computers where it is mostly a pseudo macro assembler.

Re: C Minus Minus

#50
post #23

I asked this on Ask HN sometime back but did not get a lot of responses. So asking it here because it might be of interest to people reading and commenting on this artile here. Which programming language other than C is available for most platforms? It is well known that some C compiler implementation is available for almost every computable platform. I am looking for another programming language that has compiler im…

Besides all other replies, C++.
Post reply on HN