X
Business

Google open-sources JavaScript tools

Google announced overnight the release and open-sourcing of a trio of tools designed to help JavaScript developers.
Written by Chris Duckett, Contributor

Google announced overnight the release and open-sourcing of a trio of tools designed to help JavaScript developers.

Dubbed Closure Tools, the search giant is continuing its push of JavaScript with a tool set including a JavaScript optimiser called Closure Compiler, a JavaScript library called Closure Library, and a templating system for JavaScript and Java entitled Closure Templates.

"The compiler removes dead code, then rewrites and minimises what's left so that it will run fast on browsers' JavaScript engines. The compiler also checks syntax, variable references, and types, and warns about other common JavaScript pitfalls," said the Closure Tools team in a blog post. "These checks and optimisations help you write apps that are less buggy and easier to maintain."

closurecompilertb.png

Closure Compiler results after optimising JQuery (click to here enlarge)
(Credit: Google)

The compiler is available via the command line, a RESTful API, or as a textbox on the Closure Inspector. Asking the compiler to optimise the popular JQuery library results in a 58 per cent reduction in file size but it comes with compilation warnings; making the compiler only remove whitespace gives a 40 per cent reduction with no compilation warnings — although it is outputting only compiler warnings and not errors, I don't promote blind faith in the output of this compiler without some testing first at this point in time.

It also seems that Google has fallen into the homophone hole again. Closure originated in computer science as a programming concept, with Lisp users already having the Lisp dialect called Clojure and Clozure as the common lisp implementation.

Editorial standards