I'm not sure what the author's intention was to deride C for having all these problems
He's challenging the assumption that people have that C is "close to the metal". That's definitely something people believe about C, as opposed to other programming languages, but he points out that it's no longer particularly true.
At the end of the article, the author takes a shot at suggesting some alternative approaches (Erlang-style actor model code, immutable objects, etc.
Right, exactly. That's his point. People think other languages are high-level, but C is close to the metal. But the metal C was close to is long gone, and there's now many layers of abstraction between you and the hardware--and those layers are starting to leak.
He didn't claim other languages are lower-level, and this wasn't a hit-piece on C. It's just an interesting realization. I'm detecting a fair bit of wounded pride in this thread.
If you think about a basic for loop using pointers
for (int *p = start; p < end; p++)
You know pretty much know exactly how that would look on an older CPU with no vectorization and a more limited instruction set. But there's a lot more going on under the hood now, so you can make an educated guess as to what the generated code will be, but it's a lot more abstract now. You'd have to heavily rely on intrinsics to get predictable results now. C wasn't written for modern CPUs, so compilers have to automagically translate it to something that makes more sense for modern architectures. They usually do a good job, but Dennis Ritchie wouldn't make the same language if were to write it from the ground up today.
18
u/yiliu May 01 '18
He's challenging the assumption that people have that C is "close to the metal". That's definitely something people believe about C, as opposed to other programming languages, but he points out that it's no longer particularly true.
At the end of the article, the author takes a shot at suggesting some alternative approaches (Erlang-style actor model code, immutable objects, etc.