Hacker News new | ask | show | jobs
by username223 3842 days ago
> Unreliable optimizations and performance-critical software

This is why we will not have, and should not want, a "sufficiently smart compiler," but instead a "sufficiently predictable compiler." If the compiler is an enormously complex inference system, then tiny language-level changes can result in huge performance changes (see "space leaks" in Haskell, or "auto-vectorization" in basically anything). The solution isn't adding more knobs to the compiler; it's adding easier inter-language communication. Scripting languages like Matlab, Perl, Python, and R have been doing this right for decades: make a good effort at a specific domain (math, text, statistics), and make it easy to call into lower-level code for the key pieces.

1 comments

Space leaks are a bad example imo since they happen in other languages as well.
Yeah, but having a chain of functions failing to fuse properly can be quite surprising.
There seemed to be an implication that Hindley Milner type inference leads to unpredictable performance, you can see that is untrue with ml and ocaml.