D, on the other hand, was always designed for fast compilation (If I recall correctly), and so it compiles quickly. It's important to us, but not as important as other things. You can't be the best at every task, so you have to prioritize. For example, take two implementations of D: DMD and LDC. As I understand it, DMD uses its own codegen, so it compiles quickly, but produces slower binaries. LDC, based on LLVM, compiles more slowly, but produces faster binaries, for the exact same code. My understanding is that LDC is still faster to compile than rustc, but these are the kinds of tradeoffs you have to make.
I can iterate faster in UWP, C++/CX projects than what it takes to compile my dummy Gtk-rs project from scratch.
The factors that affect it I guess are the incremental compiler and linker, binary libraries (which cargo doesn't support) and whatever the Pango bindings are doing during their compilation.
But Rust is a template heavy language, and when it comes to compile time of template heave code, Rust is an order of magnitude faster than Clang in my experience (having worked a lot in and with Boost).
DMD does all the usual data flow analysis optimizations - strength reduction, copy propagation, loop unrolling, dead store elimination, live range analysis, etc.
https://github.com/DigitalMars/Compiler/blob/master/dm/src/d...
The optimizer / code generator is the same one that Digital Mars C++ uses, which was developed in the 1980's (!). Up until 2000 or so, the code generated was about the same as gcc, though DMC++ ran several times faster.
Since 2000, all my attention has been on the D front end, and so the optimizer wasn't getting the devoted attention it had earlier.
Just recently I finished converting the DMD optimizer from C to D, and am doing the code generator. This should make the code much more tractable.
GCC 4.0, which introduced the SSA-based GIMPLE, was released in 2004, which is roughly around the same time you mentioned that the optimization quality started to diverge. This is not an accident. At the time, lots of compilers thought that they could continue to compete with GCC without doing SSA-based optimizations. GCC crushed them all one by one.
https://github.com/DigitalMars/Compiler/blob/master/dm/src/d...
I've also written a loop unroller, but it can be improved:
https://github.com/DigitalMars/Compiler/blob/master/dm/src/d...
My evaluation was based on comparing the code gen output of the various compilers, not looking at how they were achieved.
As for SSA, DMD's optimizer is based on an intermediate representation that is a binary tree. A binary tree is a form of SSA - each operator node is a value assigned once and never modified.
> Respectfully
No worries. I'm used to people telling me I can't do things :-)
The benchmarks used by the computer magazines were all dead code, and so the flow analysis deleted them. The journalists sadly concluded and wrote that DC was an utterly broken compiler :-(
This problem persisted until a year or two later when Borland and Microsoft caught up. They had much better marketing teams (!). The benchmarks got changed.