5 ms·
> It is also great at making you aware of the machine. In C, very little is happening behind the scene. This is not true. It hasn't been true for decades. C is
by Mike345845 7y ago
> It is also great at making you aware of the machine. In C, very little is happening behind the scene.
This is not true. It hasn't been true for decades. C is an abstract high level language on modern processors.
https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479
- porknubbins 7y agoTrue, but if it is still possible to be a C programmer who can more or less imagine what assembly will be generated (at lower levels of optimization at least) by their C code, then isn't the real issue that x86 assembly abstracts away a lot of hardware info about caches, pipelines, microcodes etc? In that case how can a low level exist on x86?
- UncleMeat 7y agoI'm not sure that's true. There was a highly upvoted post recently on both HN and /r/programming that claimed to have a better sorting algo than libc's sort. After hundreds of comments across both forums, looking into compiler explorer showed that the key difference was inlining. As a C++ person, basically all micro-optimizations start at "look at the damn assembly" since people really suck at predicting what code will actually be generated.
- BubRoss 7y agoHow does inlining happening in C++ mean that the asm in C isn't predictable? Even with inlining the point is mostly the same - there aren't small program changes that lead to big changes in what is generated.