While I still haven’t got around to releasing my python port of the yui-compressor (I will soon, I promise), my plan had originally been to extend the compressor into an optimising compiler for javascript – but I just stumbled upon the a Google project that seems to have beaten me to it.
The Closure Compiler (google code page) does exactly that – it takes your javascripts and optimises them for both filesize and run-time.
I haven’t looked too deep yet, but it seems that it uses the parser from Rhino, and augments it with an implementation of a javascript AST, and an optimiser that works on the generated AST.
The Closure compiler is written in Java – anyone who feels like working on a python version is likely to find pynoceros (the python version of Rhino’s parser I annouced a few weeks ago) useful.











