4 ms·
> Structures with fields and pointers to other structures is the ha-ha moment of C. It is what really makes the whole language so special How is it special at
by kaba0 3y ago
> Structures with fields and pointers to other structures is the ha-ha moment of C. It is what really makes the whole language so special
How is it special at all?
> you have full control on low level details.
Yeah, if you add random attributes to the language and control the compiler. C still can’t properly do vector instructions, while even Java can, but so can C#, Rust, C++. It’s simply not a low-level language.
- flohofwoe 3y agoDid you check out the clang vector extensions? And before "but that's not standard C!": in the C world, the interesting stuff happens outside the standard in language extensions, the standard is mostly irrelevant for real world code. What counts is what specific compilers have to offer.
- antirez 3y agoTo the point that Linux, probably the most important C project in the world, was written in the GCC dialect for many many years. I think it's no longer the case.
- flohofwoe 3y agoAFAIK the only reason why Linux compiles on Clang now too is because Clang tries to emulate GCC behaviour as closely as possible? I doubt that the Linux kernel would compile out of the box with Microsoft's C compiler for instance ;)