4 ms·
Because compilers almost never write better code than humans ? There are literally tens of thousands of bugs in the GCC and LLVM/Clang bug trackers about that.
by fluffything 6y ago
Because compilers almost never write better code than humans ?
There are literally tens of thousands of bugs in the GCC and LLVM/Clang bug trackers about that.
I don't remember the last time I read some compiler-generated asm and thought "wow, that's great code".
- saagarjha 6y ago> Because compilers almost never write better code than humans Compilers almost always write better code than most humans.
- fluffything 6y agoReally? Citation needed. Compilers are programmed by humans. You are claiming that somehow compilers have learned to produce better assembly than the humans that programmed them. I am a compiler writer, and know many compiler writers. I have yet to find one that would stand by your claim. When I look at the output of LLVM or GCC, I am ashamed. I wish I had more time to make LLVM much better, but actually, 99% of my time is spent in fixing bugs filled by users that are neither compiler writers nor assembly programmers, and they too realized how bad the machine code emitted by these tools is. So sure, a compiler emits better assembly than a human that hasn't learn assembly programming. It also emits better assembly than all humans that do not know how to program. But no, it does not produce _by far_ better assembly than any programmer that actually cares about machine code enough to just take a look at it and check it.