2 ms·
I am not sure how you are defining the "compiler" here; the compiler back end that emits code is where register allocation and peephole optimizations happen. "
by betterunix2 9y ago
I am not sure how you are defining the "compiler" here; the compiler back end that emits code is where register allocation and peephole optimizations happen.
"The compiler doesn't reason about the data"
It certainly can; it is hard in a language like C due to the deficiencies of the type system, but in other languages the programmer can more explicitly state constraints on values. Compilers can also make useful inferences about constraints based on e.g. conditional statements, loop bounds, etc.
Where humans win is in designing more efficient algorithms. Compilers are great at reducing the constants but still cannot improve the asymptotics. In other words, human effort is better spent on the higher-level concerns, and yes, some languages are better than others for that task.
"Like with chess, computer + human is the winning combination."
Chess-playing programs are so much better than humans that it is not even interesting to compare them anymore.
- davemp 9y agoAre you trying to make the “sufficiently smart compiler” argument here? The reality is that the fastest compilers for the fastest languages still require babysitting and hand written ASM for peak performance. > human effort is better spent on the higher-level concerns For most cases, yes I (and likely most people) agree. Although there are times when we do care and it is important to know that our tools are not infallible.