2 ms·
> a sufficiently portable assembly. No, it isn't, and it hasn't been for about 40 years. « C Is Not a Low-level Language Your computer is not a fast PDP-11. »
by lproven 3y ago
> a sufficiently portable assembly.
No, it isn't, and it hasn't been for about 40 years.
«
C Is Not a Low-level Language
Your computer is not a fast PDP-11.
»
https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479
David Chisnall, ACM Queue, April 30, 2018
- kelas 3y agoSounds expensive, thanks. So: Preface to the Digital Edition of Kernighan and Ritchie's The C Programming Language Oct 31, 2012 “… Remarkably, in spite of all of this change, C retains a central position. It is still the core language for operating system implementation and tool building. It remains unequaled for portability, efficiency, and ability to get close to the hardware when necessary. C has sometimes been called a high-level assembler, and this is not a bad characterization of how well it spans the range from intricate data structure and control flow to the lowest level of external devices.” (sorry, I messed up the lyrics a bit, but also I didn’t, really) Also, my computer is a fast Turing machine. And so is yours.
- lproven 3y agoI can't make any sense of a single sentence of that. > Sounds expensive, thanks Huh? What does? The paper is entirely free. That's why I posted a link. Go read it. It's not very long, it's interesting, it's accessible, it's provocative and insightful and profound. > Kernighan and Ritchie Creator of C is biased about the language he created. Shock. Pictures at 11. K&R was published in 1988. Then, your PC was to some degree a fast PDP-11. That was over 1/3 of a century ago and it is no longer even remotely true. > Also, my computer is a fast Turing machine. And so is yours. Reductio ad absurdam. Here's a talk from the inventor of the Arm architecture. It's pretty good. https://www.youtube.com/watch?v=6lOnpQgn-9s https://www.youtube.com/watch?v=6lOnpQgn-9s She talks about her more recent baby, Firepath. It can, for instance, in a single opcode and a single CPU cycle load 4 separate different 32 bit integers, multiply them by 4 other 32-bit ints and store the result. (Around 25 min in but it's very worth watching the whole talk.) Her point is that C can't express stuff like this well at all. A modern CPU has dozens of execution units doing stuff in parallel, applying matrix operations and transformations to multiple different streams of data simultaneously: SIMD and MIMD combined. C has no way of even beginning to express any of this. C is no more a high-level assembly language for any 21st century CPU than a Falcon-9 reusable orbital launch vehicle is a space-going version of the Wright Flyer.
- kelas 3y ago> The paper is entirely free. That's why I posted a link. Go read it. It's not very long, it's interesting, it's accessible, it's provocative and insightful and profound… …and I already read it and you already have my reflections on this piece of work :) > …SIMD and MIMD combined. C has no way of even beginning to express any of this. Man, no hard feelings, but I suggest you start with K&R refresher and then work your way up to modern C. It is remarkably easy to learn, you’ll come around. What you deem impossible is very possible. Once you’re comfortable with basic C, I recommend cloning the repo of Lemire’s blog. Just to see what’s available.
- kelas 3y ago> No, [C is not a high-level assembler], and it hasn't been for about 40 years. «C Is Not a Low-level Language Your computer is not a fast PDP-11.» some dude in ACM Queue Please correct me if I’m wrong, but this ACM rant seems to amount to blaming C language for the most disastrous embarrassment in the history of Intel Corp, i.e. spectre/meltdown. Well, thank you very much, but that’s just deranged thinking, or someone was on INTL payroll in 2018. but wow, thank you, what a gem. he then proceeds to elucidate how C is broken and again not low-level enough, because his 1337 skills require knowing the cache line size. well, this is absolutely true, captain Chisnall. but what is complete and utter nonsense is the conclusion that C is retarded by not letting the programmer manipulate the cache directly: “The cache is, as its name implies, hidden from the programmer and so is not visible to C. Efficient use of the cache is one of the most important ways of making code run quickly on a modern processor, yet this is completely hidden by the abstract machine, and programmers must rely on knowing implementation details of the cache (for example, two values that are 64-byte-aligned may end up in the same cache line) to write efficient code.“ This deserves a WAT.
- lproven 3y agoIt seems to me that you take a fundamentalist view on this: anything which attempts to point out the problems, inadequacies, or failings of C and possibly of xNix in general is heresy, to be mocked rather than addressed. I have often encountered this attitude in real life from fundie/evangelical christians, but in the tech world, it's also a thing among a certain hardcore xNix enthusiast. I feel that I have encountered one here, and you are not willing or not able to engage in discussion. You merely want to proselytise at me. I am not interested in that, so I won't comment further. For me, as an xNix user for some 35Y and a full-time writer about xNix for a decade or more, it's just one of many interesting, significant or valuable OS ideas, and C is a rather poor and deeply flawed language which is a vastly expensive handicap on the computer industry.