They both have goals that overlap (generating optimized javascript code), but different paths to achieve that goal.
The most obvious difference is that GWT is a java to javascript compiler; whereas closure compiler is a poor js to optimized js compiler. CC has various levels of optimization; but even at its highest level it cannot beat GWTC. GWTC is a "closed world" or "monolithic" compiler. It can analyze the entire source code of your application before making decisions. So when GWTC deletes a method, it is 100% sure that method is not being used. CC cannot make this guarantee - because you could invoke a js function from a html file (embedded script tag, javascript:method() url etc.), - and CC has no way of knowing that. In short - GWTC can guarantee equivalence between input and output; CC cannot do so in advanced modes. The use cases for Closure Compiler are also different. You'd like to use CC on a legacy application that can't be converted to GWT (or you don't want to). For a new project, however, it makes sense to go the GWT route. --Sri 2009/11/5 davidroe <[email protected]> > > I have not looked at this in any detail yet, but the first question I > have is whether this functionality duplicates the work of the GWT > compiler, given the following description: > > "Closure Compiler is a JavaScript optimizer that compiles web apps > down into compact, high-performance JavaScript code. The compiler > removes dead code, then rewrites and minimizes what's left so that it > will run fast on browsers' JavaScript engines." > > /dave > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
