3 ms·
> C at it's core is pragmatic minimalism. Pragmatic minimalism as it was for the hardware at the beginning of the 1970s, to be exact.
by red75prime 9y ago
> C at it's core is pragmatic minimalism.
Pragmatic minimalism as it was for the hardware at the beginning of the 1970s, to be exact.
- jstimpfle 9y agoThe C machine model is still the only model I can easily program and not make a mess. And without being a hardware architecture expert: Has so much changed on the assembly level? And what other languages are truer to today's machines?
- pjmlp 9y agoNone of them are, not even Assembly, unless the CPU executes the opcodes directly in hardware without micro-code help. The C machine model says nothing about vector instructions, instruction re-ordering, NUMA, GPGPU, IO ports, Harvard architecture, multi-core.
- comex 9y agoAs of C11, the C machine model does (finally) include threads and memory ordering, so at least you can say it says something about multi-core…
- red75prime 9y agoModern C compilers do enormous job of optimizing C code, despite its shortcomings like the lack of distinction between pointers and arrays. You don't need to worry too much about that, maybe you'll need to sprinkle vectorization intrinsics or assembler code if the compiler isn't smart enough, or to add a couple of memory barriers.
- vardump 9y agoWould mostly sign that, but not without inspecting security or performance critical code in disassembler. Modern compilers are still rather bad at vectorization. What's worse, those optimizations are often unstable. A small change might make code several times slower. Performance regression tests and when that fails, vector intrinsics are a must.