Compiler Optimizations Should Pay for Themselves (1994) [pdf]
pdfs.semanticscholar.org
pdfs.semanticscholar.org
I don't think the go team worry about the size of the object as much though.
And if you are developing scientific software I suspect that it is as developer friendly as most currently common languages.
Other examples include register allocation which you can either do slow using graph coloring or fast using linear scan. Graph coloring leads to better code, but much slower compilation times.
The compiler optimization that "pays for itself" is like a holy graal, it doesn't exist. :) No such thing as a free lunch. In the article they admit that, but argues that the somewhat slower compile times is worth it.
Apparently the only time they really violated this rule was when rearchitecting their compiler from using 5-6 distinct IR languages to over 30 of them using the "Nanopass" approach. So I assume the compile time simply went from "a few seconds" to "a few more seconds", but that's probably OK to do once over ~30 years, I guess. :)
I was told once (by one of the developers of) the Microsoft C# compiler team followed a similar rule where they never made a release that regressed their internal compiler benchmarks, i.e. they were only allowed to get faster. Obviously the .NET runtime does a huge amount of heavy lifting in terms of a C# programs performance, making the compiler a bit simpler, but it still means things like optimizations must pay off in speed and effectiveness. They even rewrote the compiler from C++ to C# at one point and still met this goal somehow, apparently, and once you're at that point -- bootstrapping yourself -- you begin the virtuous cycle of self-improvement. I'd be interested to know if any C# developers have seen the Microsoft .NET compiler get slower -- everything I've heard is that it's very fast and nice to use.
> Trying to make an optimizing compiler as simple as possible and yet as powerful as necessary requires, before all else, a measurement standard, by which both simplicity and power can be judged.
The goal is not to use the compiler as a proxy for runtime performance of other compiled programs, but rather a benchmark of a particular value (or maxim). You may not share that value, but I think you've mistaken the motivation.
I think the delta of agreement here is small; I just mean to note that “justified” here includes the value of the simplicity of the compiler. I have a personal bias towards the paper of course, because I would love to be downstream of a fallacy that gave me the development ergonomics of any of the Wirth or Wirth-like languages.
Yeah, this might have been wise in 1994 but this is just spectacularly bad advice now.
[1] https://techcrunch.com/2017/09/14/aws-now-offers-a-virtual-m...