3 ms·
Yes 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 m
by skohan 7y ago
Yes 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.