3 ms·
After 50 years it doesn't seem like it, but C has managed to survive this long because it's a solid all-round player from the bare metal to web servers. It's s
by phoehne 4y ago
After 50 years it doesn't seem like it, but C has managed to survive this long because it's a solid all-round player from the bare metal to web servers. It's simple enough that you could probably implement a fairly capable C compiler in assembler.
- tenebrisalietum 4y agoC has managed to survive this long because of: - Unix and its inertia - Licensing of Unix allowing it to proliferate to the masses and being used for education - because it is simple enough that a compiler can be quickly brought up for any new ISA that appears, as long as it looks enough like a 70's-80's CPU architecture enough for pointers to work. Elegant? No. - Making pointers and arrays synonymous is elegant only from the CPU's perspective. - The pointer syntax sucks. - Casting does weird stuff sometimes. - Bool - how hard is it to get true and false right? - Everything being an operator leads to the confusion between assignment and equality which is inelegant. It was cute in the 70's when you had limited disk space but sucks now. - `void *` being used for function pointers is not elegant. - Threads and any notion of multiple CPUs doesn't work well without a lot of libraries or help. - An elegant language would have not cared about the underlying CPU memory model, but C had to be enhanced for 16-bit x86 segmented memory models. - If you are using intrinsics or whatever to generate assembly opcodes (e.g. vector instructions) because your language doesn't support them, you are surpassing the limitation of your language in an inelegant way. - An elegant language makes things like the IOCCC impossible.
- t-3 4y ago> - Bool - how hard is it to get true and false right? I think this is actually much more complicated than it seems at first thought. There are a lot of different ways to represent booleans, each with their own advantages, and then the hardware has it's own ideas that might need to be considered. I'm not sure that there's any way to do bool that doesn't lead to pain somewhere.
- kevin_thibedeau 4y agoC23 is making true and false _Bool typed values.
- Comevius 4y agoThose damn C preprocessor macros. You have to become a compiler to understand C code. The elegant metaprogramming approach is what Zig does with comptime.
- 0xbeefeed 4y agoNo, Rust sucks
- anthk 4y ago>- An elegant language makes things like the IOCCC impossible. Pffffffft... bahahah. No. You can write unreadable turds in ANY language.