3 ms·
I fail to see to the point of your post in context of this thread. What, in the parent post, do you consider a myth?
by lelanthran 3y ago
I fail to see to the point of your post in context of this thread.
What, in the parent post, do you consider a myth?
- pjmlp 3y agoC's original performance. Optimization taking advantage of UB had to be introduced during the 1990's to make it into a reality. Until the widespread of 32 bit hardware, even junior Assembly devs could relatively easy outperform C compilers. Which is what the interview is about, originally C lacked the optimization tools, relying on developers, with tons of inline Assembly.
- lelanthran 3y ago> Which is what the interview is about, originally C lacked the optimization tools, relying on developers, with tons of inline Assembly. I'm afraid that is not the conclusion I draw from the snippet you posted. It's very clear to me that the HLL under question at that time prevented the programmer from performing the low-level optimisations that the C programmer could optionally do. The debate appeared to be be whether to let the language exclusively optimise the code, or just do no optimisation and let the programmer do it. This is why the sentence ": Oh, yeah. That would have been fine. And, in fact, you need to have something like that, something where experts can really fine-tune without big bottlenecks because those are key problems to solve. " is in there - it's because the HLL languages literally wouldn't let the programmer optimise at the level that C would let the programmer optimise. Honestly, if the proponent for the HLL language didn't add in "Use the HLL, but not for OS and low-level code where you really need to fine-tune", you'd have a point, but they said it, and so you don't.
- pjmlp 3y agoRight, that is why C code was polluted with inline Assembly until optimizers started taking advantage of UB. Inline Assembly isn't C.
- memefrog 3y agoOf course inline assembly is C. Most languages don't let you do inline assembly. That isn't because they don't like it, but because the way those languages get translated to machine code is highly variable. C is the only language where the semantic model is simple enough that you can see how every language construct would translate to assembly language and write your own inline assembly language in between.
- pjmlp 3y agoIt definitely isn't. What page of C standard describes it? As for the rest of your comment, unless you are using a PDP-11, you will be surprised.
- memefrog 3y agoC predates the C standard, which describes a common subset of C implementations. It is useful for writing code which works across a variety of implementations. For example, you can write code that works on the Byzantine optimising compilers, which will attempt to render your code incorrectly if at all possible, but will make strictly conforming programs run very quickly. But it is not necessary to write code to the C standard, and many C implementations do not conform to it. The Plan9 C compiler, for example, expects 'void main(void)' for a program's main function, while the standard requires 'int main(void)'.