|
|
|
|
|
by nrclark
1464 days ago
|
|
Fwiw C is actually a huge abstraction over modern hardware. It's a good representation of the PDP-11 and similar-era computers. It's also a good abstraction for modern microcontrollers. C's view of the world is also a really poor fit for today's larger CPUs. Your computer has to jump through a ton of hoops to make itself seem C-like. C has no concept of vectorization, speculative execution, branch prediction, multiple cores, caches, MMUs, etc. For basically any desktop/laptop/smartphone CPU, the C runtime is more like a little VM than an accurate model of the hardware underneath. |
|
OK, but vectorisation is exposed by the instruction set, as instructions[1]
> speculative execution, branch prediction, ... caches, MMUs
How would you expose speculative execution & branch prediction? Cache behaviour is well understood so what's wrong with it? What would you do to expose MMUs to the programmer, and what would they do with it/how would it help?
[1] but aren't there libraries that expose it just fine in a portable way?