Google released this week Google Web Toolkit (GWT) 1.4, the first non-beta release of this popular open-source Ajax toolkit. At the heart of GWT is a Java-to-JavaScript compiler that allows developers to write an Ajax application in Java, and then compile that application into highly optimized JavaScript that can execute in the browser. In releasing the first non-beta version, Google's Bruce Johnson and Dan Peterson commented that:
Google Web Toolkit is an open source project that helps Java developers harness the richness of AJAX in a cross-platform, web-friendly environment. The magic trick is that GWT cross-compiles Java source code into standalone JavaScript that you can include in any web page. Instead of spending time becoming JavaScript gurus and fighting browser quirks, developers using GWT spend time productively coding and debugging in the robust Java programming language, using their existing Java tools and expertise. Naturally, GWT is also a great way to easily take advantage of the latest-and-greatest Google APIs and browser enhancements, such as Google Gears.
In addition to making debugging far easier, GWT's unique compilation-based approach to AJAX has the nice property that it rewards developers for good software engineering practices. Java source code that is clear and organized can be easily optimized by the GWT compiler, which is a nice antidote to the frequent hack-and-slash approach that's all too common in JavaScript development. As your application grows, the GWT compiler begins to pay off in even bigger ways. Unused code is automatically removed so that scripts are smaller and pages load faster. Complex code can be automatically coalesced and simplified. Most importantly, because the Java language is statically typed, many common errors can be caught during development rather than production. You can observe the high-performance results yourself in GWT's sample Mail application.