> Regarding #2, it's conventional wisdom that you can't beat a compiler, but I'm sure DJB is going to show examples where he beats the compiler significantly.
Is the fact that a compiler can beat you sometimes[1] really that controversial?
And he better have a large class of problems in which he can beat the compiler, without using too much time[2]. Or else the title is just needlessly provocative.
And thirdly: many of just rely on the compiler doing a good enough job. Not a better job than we would do if we were more careful.
[1] Or often times. Depends on who you ask, and in what domains.
[2] Or else you can just say that a programmer can beat a compiler given enough time, where time can be arbitrarily long. But all of us have some kind of time constraint.
That doesn't surprise me for two reasons: 1) DJB is a great programmer. 2) Compilers are so complex that there are lots of non-obvious reasons that they miss optimizations.
I'm not an expert, but it appears to me that, in the last 10 years, processors have gotten complex at higher rate than compilers have gotten better. There's just more room to do nontrivial things that have come up only recently.
I found this interesting portable ASM DSL on DJB's site: http://cr.yp.to/qhasm.html
Honest question: Can you write C that compiles to what his qasm programs do with a modern C compiler? (I suspect the answer is no, because DJB writes tons of C and wouldn't have written it othewise)
Older perf notes on his site: http://cr.yp.to/hardware/x86.html
On the other hand, DJB writes a very particular type of software (crypto and mathematical code lately), so I suspect his experience won't be that generalizable. But it will be correct and important, because his niches are important.