5 ms·
This is kind of the point of C. It maps directly to the hardware. There are very few decisions the compiler has to make about the code. And it is for that reaso
by MadWombat 7y ago
This is kind of the point of C. It maps directly to the hardware. There are very few decisions the compiler has to make about the code. And it is for that reason that C does not allow for higher level abstractions. On one hand, it is a pain to write. On the other hand, you know exactly what is going on under the hood and nothing is ever going to stop you from shooting yourself in a body part of your choice :)
- kllrnohj 7y ago> This is kind of the point of C. It maps directly to the hardware. No it doesn't. It didn't in the past, it was a high-level abstraction. And it doesn't today, because CPUs don't behave at all like C's defined virtual machine.
- justinmeiners 7y ago> CPUs don't behave at all like C's defined virtual machine What "virtual machine" are you referring to?
- saagarjha 7y agoThe one defined in the standard.
- anticensor 7y agoOne that ISO 9899 refers to as its abstract machine.
- ncmncm 7y agoC gives the illusion of mapping to the hardware. Hardware manufacturers have moved heaven and earth to help maintain the illusion. It finally got too hard and they had to admit atomics and cores ro the model. The next watershed will be along soon enough, but the ability to present as a C machine has long been the gateway to success or failure of a new hardware architecture. Myriads of arguably superior machine designs have foundered on "but can I code for it in C?"
- tinus_hn 7y agoHow can it map directly to the hardware and be portable at the same time?