C Is Not a Low-Level Language: Your Computer Is Not a Fast PDP-11
C Is Not a Low-Level Language (2018)
In the wake of the Meltdown and Spectre vulnerabilities, this article argues that C is not a low-level language. Modern processors and compilers have become incredibly complex to maintain the illusion that C maps directly to hardware. The quest for instruction-level parallelism and speculative execution, driven by C's sequential abstract machine, led to these security flaws. Compilers like Clang require hundreds of thousands of lines of code to optimize C, and language features like structure padding and unspecified values hinder performance. The article contends that C's abstract machine no longer matches modern hardware, making it a high-level language that demands a 'sufficiently smart compiler' to run fast.
The root cause of the Spectre and Meltdown vulnerabilities was that processor architects were trying to build not just fast processors, but fast processors that expose the same abstract machine as a PDP-11.