Incremental Compiler Update #dartlang
By incremental compilation, I mean that after an initial full compile (which is slow), the compiler will continue running and quickly compile patches to the result of the full compilation. The time it takes to perform a full compilation scales in the size of the entire program (including all imported libraries, including the SDK). The time it takes to incrementally compile should be proportional to the size of the change (and how much code is affected by that change).
For example, if it takes 30 seconds to compile a program with 10000 methods, it should take 0.003 seconds to incrementally compile a change to a single method body.
There some additional effects that can impact compile times, for example, if you change a large file, the time it takes to compute a difference may become significant (in extreme cases, I've seen 0.3 seconds used on analyzing a 2.5MB source file). Likewise, if you add a method to a class C, the compiler may have to examine all methods in subclasses of C. For example, as a thought example, let's consider what could happen if you could add a method to Object (in practice, you can't). But for the sake of an example, if a method was added to Object, the incremental compiler might decide to compile all methods in all classes.
But in practice, these caveats shouldn't matter. Most of the time, the compiler should be faster than you can notice, and rarely feel sluggish.
And now to the update. I'm currently working towards turning this into a product you can use in your daily development. This is the list of things that needs to be implemented before I feel it is ready for users:
* Better error recovery. Sometimes, dart2js will give up and abort compilation by throwing an exception if it detects a compile-time error. In this case, the compiler is left in an inconsistent state and we have to restart the process by performing a full compilation. That's really bad as the compiler is supposed to help the developer detect errors, not punishing them for making mistakes.
* Native classes.
* File watching compiler server.
I'm currently focusing on error recovery.