views:

785

answers:

3

I've used YUI ,which is too heavy.

What about GWT?

+3  A: 

GWT is a Java-to-Javascript compiler. It will take Java source code and compile it to JavaScript that runs in the browser. Being a compiler, it knows everything that there is to know about your program, so it's able to optimise your code (as well as its own code) in much the same way that a C compiler optimises C programs.

The end result is that there is no javascript library for your users to download. There's only your application, and your users will only download as much javascript as your application actually uses. You can even defer binding so that modules are loaded only when needed.

For example, jQuery is about 3400 lines of JavaScript code, and compresses to about 15kB. The equivalent Java code compiles to 720 bytes with Google Web Toolkit.

Apocalisp
With GWT, I worry about the unsupported browsers. For instance, the StockWatcher tutorial fails on my Blackberry Curve under Opera. If I'm working with a client-side library, I can often find and avoid the problem, but I have no idea how I'd do that with GWT.
Nosredna
I'm surprised to hear that Nosredna, I am able to run StockWatcher on my Blackberry Curve using Opera without any problems.
Templar
Is it possible to compress the javascript code before present to final users?
Shore
You can compress it like any other JavaScript. But the scripts generated by GWT are already very small.
Apocalisp
Can you make an example how small the scripts generated by GWT are?
Shore
Have a look at GWTQuery to see just how small these things can get.
Apocalisp
+1  A: 

They weigh different amounts, but both fall at the same speed if dropped from a high tower. Something to do with the laws of physics I think ;)

That's all I can answer based on such a vague question.

rustyshelf
Actually, the Earth's gravitational affect on each is the same, but since YUI is heavier, its gravitational affect on the Earth is greater than GWT's is, so Earth will fall faster towards YUI than towards GWT.
Don Branson
I'd argue that GWT has the larger mass of the two. Either way we should conduct a scientific study to determine the true answer.
rustyshelf
A: 

I have uploaded a benchmark demo by Ray Cromwell the creator of GQuery to my appstore. You can check it out here: http://letusdemo.appspot.com/

It does a live benchmark comparison of using jquery, compiled GQuery (which uses GWT) and Dynamic GQuery(for when you are in development mode). The compiled GQuery for me gives atleast a 100% improvement in performance as compared to jQuery.

You guys should check out GQuery. Its a pretty good port of jQuery to GWT.

Drunken Programmer