Ehh.. these days even assembly wouldn't constitute a low level language. The machine code that's generated still doesn't run precisely as described. Modern CPUs perform so many optimisations at runtime in terms of instruction re-ordering, register remapping, skipping no-op instructions that even assembly doesn't fit as an accurate description of what the hardware will do.
The thing is, as a programmer you have no control over how those CPU tasks are done - except, of course, if there is a bug that leads to Spectre and others. So, what does it matter if assembler does not account for such tasks?
That's like saying that you're not a true expert car driver because you can't access the steering hydraulic pump with your bare hands to control it.
But I think that's precisely the point of the article - modern "fast" processors are so complex that even plain old assembly isn't low level in the truest sense. So a question is - could we do with simpler (dumber) processors, and assembly that is closer to how processors work today (multithreading, vectorisation, cache), but is not supportive of C?
Well the reason why we've reached this point is because it irritatingly went down the rabbit hole of saying "Well X isn't low level because Y"
Truth is the answer is no, C as a language is close enough to the code ran on the hardware and does not try to abstract away a large amount it does qualify as low level.
In theory, you can load microcode into most types of hardware to control lower-level behavior, and even make your own instructions. In practice, the hardware vendors don't allow end-users or even OEMs to do that any more.
Which is ultimately the point of the article tbh. Things have been written in C for decades, so processors expose an interface similar to the kind that C compilers have historically targeted despite operating completely differently under the hood these days.
Maybe that point would have been better made if the author had titled it as "Assembly Is Not a Low-Level Language".
these days even assembly wouldn't constitute a low level language.
Actually, yes, it is. The Assembler doesn't actually run the code. It just puts the bytes together in the correct order - hence the name "assembler". What the CPU chip does with the code has nothing to do with the assembler. Look, there has to be a low level language. You can't go from nothing right to high level in one shot. It doesn't work that way. That low level is assembler.
17
u/Chippiewall May 01 '18
Ehh.. these days even assembly wouldn't constitute a low level language. The machine code that's generated still doesn't run precisely as described. Modern CPUs perform so many optimisations at runtime in terms of instruction re-ordering, register remapping, skipping no-op instructions that even assembly doesn't fit as an accurate description of what the hardware will do.