Live data from Hacker News

C Minus Minus

en.wikipedia.org

61–70 of 75 posts

Re: C Minus Minus

#61
post #21

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…

Yeah, not too many people write a back end these days.

Re: C Minus Minus

#62
post #34

this 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…

It's not really meant as a competitor to C, and AFAIU, it's meant as a target for a compiler front/middle end, not as a language to write code in manually. Unless you're hacking GHC itself, you're rather unlikely to touch it.

Re: C Minus Minus

#63
post #21

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…

what's SSA-form?

Re: C Minus Minus

#64
post #21

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…

what's SSA-form?

An IR form where each variable is assigned to exactly once. It makes reasoning about a lot of local properties cleaner since you know that the value of a register is set by its single def site.

The idea has also been expanded to modeling heaps for aiding reasoning about field loads and stores.

Re: C Minus Minus

#65
post #5

Related: 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

Added above. Thanks!

Re: C Minus Minus

#66

When Java came out, before it stabilized, it was often jokingly called C--.

My coworkers used to joke that we used C++ but wrote C--. I never knew the Java joke or that someone made it into an actual standalone language.

Re: C Minus Minus

#67
post #34

this 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

Re: C Minus Minus

#69
post #34

this 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

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 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.

https://en.cppreference.com/w/c/language/conversion

Re: C Minus Minus

#70
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/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.
Post reply on HN