Earlier quoted context omitted.
C does not have implicit casts
C most certainly does have implicit casts, and they are everywhere. Simple example: // malloc returns *void, but C casts it to *char char *p = malloc(10); There are tons of implicit casts when working with integers of different sizes, another example: // subtraction of ints of different signedness // C casts signed int 10 to an unsigned int assert(2U - 10 == 4294967288); Arrays decay into pointers which is another im…
C Minus Minus
71–75 of 75 posts
Re: C Minus Minus
#72Earlier quoted context omitted.
LLVM - Initial release: 2003 C-- - Initial release: 1997
That by itself only explains the initial decision. It’s still interesting that they’ve stuck to it for 20 years after LLVM’s release. Lots of technical details of GHC changed during that time, it’s not like the architecture is set in stone.
> 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 was not replying to:
> It’s still interesting that they’ve stuck to it for 20 years after LLVM’s release.
Changing the backend from their own IL to LLVM IR several years later is not exactly a "just sticking to LLVM IR" story. Knowing that C-- predates LLVM explains why they chose to implement their own IL.
Re: C Minus Minus
#73Earlier quoted context omitted.
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/i…
Good post. Too many people act like there is C or C++, then nothing else. As Pascal shows and along with others, there are various options, if one chooses to see them.
The number of platforms Pascal is available looks impressive! Can you mention some of the others like that? You say there are various options. What are those?
Re: C Minus Minus
#74Earlier quoted context omitted.
> 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
#75Earlier quoted context omitted.
Good post. Too many people act like there is C or C++, then nothing else. As Pascal shows and along with others, there are various options, if one chooses to see them.
> As Pascal shows and along with others, there are various options The number of platforms Pascal is available looks impressive! Can you mention some of the others like that? You say there are various options. What are those?
Lots of activity and talk to try to push Rust into being a stronger alternative too. There are also the other newer C alternative languages and languages that compile to C (Nim, Vlang...), that can be directed towards this purpose. Speaking of Vlang, there is now a project for it to compile to Pascal, as one of its backends (in addition to C and WASM).
So... Pascal, Ada, Java, Go (including TinyGo), Rust (future), and others mentioned (future/transpile to C)...
Don't get me wrong, C dominates. But, depending on what is being done, its not the only language that has to be used or it can be written in something else that transpiles to it.