Google open-sources JavaScript tools

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

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."

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.

Topics: Google


Chris started his journalistic adventure in 2006 as the Editor of Builder AU after originally joining CBS as a programmer. After a Canadian sojourn, he returned in 2011 as the Editor of TechRepublic Australia, and is now the Australian Editor of ZDNet.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Related Stories

The best of ZDNet, delivered

You have been successfully signed up. To sign up for more newsletters or to manage your account, visit the Newsletter Subscription Center.
Subscription failed.