BT

InfoQ Homepage News Interview: Bruce Johnson discusses Google Web Toolkit

Interview: Bruce Johnson discusses Google Web Toolkit

This item in chinese

Bookmarks

Google Web Toolkit (GWT) tech lead Bruce Johnson discusses the design of GWT, how GWT converts Java into JavaScript, community involvement with GWT, new features in GWT 1.4, and the philosophy behind GWT.

Watch Bruce Johnson discusses Google Web Toolkit (11 minutes).

From the interview:

I guess maybe people's first impression was: "This is a sort of translator"; it was a little dismissive until they got to see what it was really doing under the covers. They assumed that we were somehow blindly translating a particular Java construct into something in JavaScript, so that it would lead to bloated code and so on. Actually we take a much more computer science-y, and more aggressive approach to that which is that we parse all the Java source together and do some pretty aggressive optimizations on it. We disallow reflection and dynamic class loading, intentionally. The advantage of that is you can do whole-program optimizations when you know that there aren't pieces that are not analyzable by the compiler. Reflection kind of defeats full static analysis since you never really know what is going to happen until runtime, but if you take that out of the equation, you can compile a large source code base of Java and if you compile it monolithically then you can analyze every single call site, every method implementation.

You can identify things that appear polymorphic but really aren't, we call that "type tightening". Once you do that you eliminate polymorphism, you rewrite call sites and translate polymorphic dispatches into static dispatches and once you do that you can inline the code which allows you to do another iteration of other optimizations. So it is a real compiler and we've really only scratched the surface with the optimizations I mentioned and there are a lot more cool optimizations that we can do in the future. The benefit to GWT users is that all they have to do is upgrade the new version of GWT, recompile and they get a huge benefit in either size or speed or both. For example in 1.4 which is the next upcoming GWT release, a simple recompile will gain you about 20% size reduction and faster start-up time.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Can anyone play the video

    by Toby Jee /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Hi guys,

    Tried to play the video but it doesn't work. Just wondering if its just me, can anyone play the video?

  • Re: Can anyone play the video

    by Toby Jee /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Sorry my bad. I'm able to play it. False alarm. :P

  • Re: Can anyone play the video

    by Przemyslaw Rudzki /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    It only plays first 2 seconds then it dies.

  • Re: Can anyone play the video

    by Milen Kostadinov /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    After 2-3 page refresh..the video start :)

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.