|
|
|
|
|
by aap_
1457 days ago
|
|
> As they say, C was designed for the PDP-11 architecture Not really though. A linear address space was not particularly specific to the PDP-11. The one point where C really was made to fit the PDP-11 was the addition of a byte datatype (aka char), but the PDP-11 wasn't unique in that regard either. |
|
- Uniform memory, cache memory is small, optional and transparent.
- A single linear address space; no pages, stack in the same RAM as data.
- A single CPU, with a single scalar ALU, and completely in-order execution; no need for memory barriers.
A typical modern machine larger than an MCU has several level of memory hierarchy which affect performance enormously, the physical RAM is mapped all over the address space, several execution units process data in parallel and often out of strict order, there are many variants of vector (SIMD) instructions, and usually a whole vector co-processor ("graphics card"). This breaks many of the assumptions that C initially ha made, and hardware tries hard to conceal the memory hierarchy (well, your OS may allow you to schedule your threads to the same NUMA domain), to conceal the parallel execution, to conceal the memory incoherence between processing nodes, etc. Well, you sort of can make the compiler infer that mean a vectorized operation, or use an intrinsic.
In my eyes, the C's assumptions about hardware show their age, and also hold the hardware back.