7 ms·
It's not a case of parts being out of date. It's the C abstract machine that is a different model to the machine's. More specifically, C was designed in the PDP
by ChrisSD 7y ago
It's not a case of parts being out of date. It's the C abstract machine that is a different model to the machine's. More specifically, C was designed in the PDP-11 era. Hardware has evolved since then which makes it a poor choice if you are wanting to build a mental model of what your computer is "actually doing".
- skohan 7y agoYes but I am asking in what way the abstraction is no longer accurate. Your computer is still more or less doing the following no? - allocating/deallocating memory - reading and writing values from/to memory locations - performing arithmetic and logical operations on values
- ChrisSD 7y agoYes the machine can do those things, you're right. If that's all you meant then sure the abstraction is enough. But you can learn those broad concepts using Python if you want to. However, what the machine is actually doing can differ substantially from these naive models. An algorithm that should be slower according to the C model can in reality be fast. Registers, cache levels, vectorization, etc are all concepts that C doesn't teach. Compilers often have extensions to C that enable more direct access (and also do things like adjust memory layout) but at that point you're no longer using the C model. Optimizing compilers (and even cpus themselves) also do a good job of trying to uphold the abstraction but at the end of the day it's still leaky. So knowing what the machine is actually doing is helpful.