Re:Hobby x86 kernel written with Zig
by klyrs on Monday January 06, 2020 @11:26AM
(#21970363)
> ... caring about the assembly output is a spectacular case of premature optimization.
This is a hobgoblin. Assembly output of a compiler is the very baseline of performance. It requires no effort on behalf of the programmer (aside from learning a language).
Now, if you're skimming the assembly after every compilation and, say, fuzzing your implementation to coax the compiler to emit the best possible assembly... that's probably premature. If you're writing inline assembly before doing a higher level implementation, that's probably premature.
But choosing a language on the basis of its performance:effort ratio is downright pragmatic.
This is a hobgoblin. Assembly output of a compiler is the very baseline of performance. It requires no effort on behalf of the programmer (aside from learning a language).
Now, if you're skimming the assembly after every compilation and, say, fuzzing your implementation to coax the compiler to emit the best possible assembly... that's probably premature. If you're writing inline assembly before doing a higher level implementation, that's probably premature.
But choosing a language on the basis of its performance:effort ratio is downright pragmatic.