The API cut ended up being in a different place with LLVM and WebAssembly. But the core idea still stands, and has been a hot potato for many years. In some ways, things are better now since there are fewer architectures than in the 90'es, so you don't have to support that many backends. On the other, things are worse because the amount of work you have to sink into a backend is non-trivial and ever growing. One part…
C Minus Minus
61–70 of 75 posts
Re: C Minus Minus
#62this version of c-- does not address some of the bloat and shortcomings of the C syntax: should have no integer promotion, no implicit casts (except for literals like rust? and void* ofc namely), have runtime/compile-time casts, idem for "constants", no horrible typedef/enum/_generic/etc, only sized type (my heart is split between uw/u16,sdw s32, etc), variable arguments of preprocessor macros definitively defined, o…
Re: C Minus Minus
#63The API cut ended up being in a different place with LLVM and WebAssembly. But the core idea still stands, and has been a hot potato for many years. In some ways, things are better now since there are fewer architectures than in the 90'es, so you don't have to support that many backends. On the other, things are worse because the amount of work you have to sink into a backend is non-trivial and ever growing. One part…
Re: C Minus Minus
#64The API cut ended up being in a different place with LLVM and WebAssembly. But the core idea still stands, and has been a hot potato for many years. In some ways, things are better now since there are fewer architectures than in the 90'es, so you don't have to support that many backends. On the other, things are worse because the amount of work you have to sink into a backend is non-trivial and ever growing. One part…
what's SSA-form?
The idea has also been expanded to modeling heaps for aiding reasoning about field loads and stores.
Re: C Minus Minus
#65Related: Welcome to C-- (2008) - https://news.ycombinator.com/item?id=30006215 - Jan 2022 (23 comments) The C-- Language Specification (2005) [pdf] - https://news.ycombinator.com/item?id=19429522 - March 2019 (27 comments) C--: A Portable Assembly Language - https://news.ycombinator.com/item?id=17966114 - Sept 2018 (1 comment) C-- - https://news.ycombinator.com/item?id=6621679 - Oct 2013 (72 comments) Pretty sure the…
https://news.ycombinator.com/item?id=30044788
Re: C Minus Minus
#66When Java came out, before it stabilized, it was often jokingly called C--.
Re: C Minus Minus
#67this version of c-- does not address some of the bloat and shortcomings of the C syntax: should have no integer promotion, no implicit casts (except for literals like rust? and void* ofc namely), have runtime/compile-time casts, idem for "constants", no horrible typedef/enum/_generic/etc, only sized type (my heart is split between uw/u16,sdw s32, etc), variable arguments of preprocessor macros definitively defined, o…
Re: C Minus Minus
#68Re: C Minus Minus
#69this version of c-- does not address some of the bloat and shortcomings of the C syntax: should have no integer promotion, no implicit casts (except for literals like rust? and void* ofc namely), have runtime/compile-time casts, idem for "constants", no horrible typedef/enum/_generic/etc, only sized type (my heart is split between uw/u16,sdw s32, etc), variable arguments of preprocessor macros definitively defined, o…
C does not have implicit casts
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 implicit cast, I don't think an example is needed though.Anyways these are just a few common examples, there are tons more and many of them are pretty subtle and error prone.
Re: C Minus Minus
#70I 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/i…