The poor C programming language is ridiculously out of fashion.  Critics like to explain how, Dennis Ritchie didn’t know any math, or that the type system of C fails to invoke any category theoretical concepts and that, unlike in the antique days of the PDP-11, modern processors do not have “flat memory” but feature these whiz-bang new ideas called caches.  I’m not kidding.

Consider another core part of the C abstract machine’s memory model: flat memory. This hasn’t been true for more than two decades. A modern processor often has three levels of cache in between registers and main memory, which attempt to hide latency. The cache is, as its name implies, hidden from the programmer and so is not visible to C. […]  David Chisnall in ACM Queue 

This article was from 2018. Woah! Too bad the hapless Dennis Ritchie never heard of such things way back in the 1970s when caches not been discovered (actually, the first PDP11 with a cache came on market in 1975).  Anyways, all this made me think that (1) CS education really sucks and (2)  the flat memory model has become more attractive recently.

Imagine a high speed processor with a very fast, small, say 2M, local memory and a single I/O device for asynchronous message transfer from main and I/O memory. Suppose we had 1028 slots where we could put a start address, a count of say 128byte lines, and a code for load/store/conditional-store. There would be a condition code for “pending/failed/done” with maybe a couple of different error codes for failure (memory fault, write to read-only, read-from-write-only, condition-not-met … ). The processor might have registers (another brilliant idea David Chisnall explains in his essay), I don’t care, but it would be relatively simple and we could even combine this idea with my previous one about omitting interrupts.

Wait, maybe they have some ideas in Cambridge about how to make this memory seem larger by shuffling it in and out of the main memory. We could call it, I don’t know, virtual memory or something. Wow!


 

  • Also Chandler Carruth’s video is an eye opener. Who knew compilers could not prove correctness of programs!??? No wonder us antique C programmers are so hapless.

 

Flat address spaces: another crank idea for computer architecture
Tagged on: