A JavaScript Optimizer

I’ve been learning about Clojure over the last month or two, which is a dialect of the Lisp programming language that compiles to the JVM.  That has nothing to do with this blog except that it led to finding Google’s Closure Tools.

Closure Tools include a JavaScript Optimizer, a comprehensive JavaScript library, and an easy templating system for both Java & JavaScript.

The most interesting piece at first glance is the optimizer.

The Closure Compiler compiles JavaScript into compact, high-performance code. The compiler removes dead code and rewrites and minimizes what’s left so that it downloads and runs quickly. It also also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. These checks and optimizations help you write apps that are less buggy and easier to maintain. You can use the compiler with Closure Inspector, a Firebug extension that makes debugging the obfuscated code almost as easy as debugging the human-readable source.

It is apparently used fairly extensively in Google Reader.

Leave a Reply