On 7/20/2017 1:20 AM, Vladimir Panteleev wrote:
Later that day, I mentioned in passing that we might make building D part of the
build process (of a project using D code), since building the compiler took only
3 seconds on my machine.
To quote my colleague:
"Whaaaaaaaaaaat? How can a compiler compile in 3 seconds?!"
Back in the 80's (!) computer magazines regularly ran C compiler benchmark
results. (At one time I counted 30 C compilers available for the PC.)
I took a class at Standford on compilers, which included a lot of info on data
flow analysis. I decided to implement it. Data flow analysis optimizations
basically deleted the benchmark code, because it didn't do anything (lots of
dead assignments). This compiler was released as Datalight Optimum C.
The article writer concluded that the compiler had a giant bug in it, because it
ran the benchmarks impossibly fast, because it deleted the dead code. Instead of
being lauded as the only C compiler on the PC that did global data flow
analysis, it was labeled as a buggy piece of crap.
By the time we dug ourselves out of that PR disaster, other compilers had
implemented it, too.
Ironically, these days DMD gets repeatedly charged with not doing data flow
analysis, and clang is assumed to have invented data flow analysis.
Just goes to show the power of marketing :-)