Tuesday, January 09, 2007

GWT: Compiling Java to JavaScript


While browsing through the Ajaxian blog, I also ran across this interview by Frank Sommers with Scott Blum, the Google software engineer behind GWT's Java-to-JavaScript compiler, talks about the challenges of turning Java source code into JavaScript.

The following questions have been answered by Scott:

  • Could you start by giving us an overview of the GWT development process?
  • What are the biggest differences in the JavaScript the GWT generates for the various browsers?
  • What happens to a Java class when it's compiled into JavaScript?
  • What are prototype-based objects?
  • What types of Java code are the hardest to translate to JavaScript?
  • You mentioned that browser-specific functionality is brought into the compile process from external libraries. Can you explain how that works?
  • Once you have those browser-specific versions, how do you deploy them so that each browser gets only the code aimed for it?
  • You said earlier that JavaScript is more flexible than Java. In what way do you take advantage of more flexibility in JavaScript to get, say, better performance, or more concise code?
  • In addition to excellent Java developer tools, what do you think are the biggest differences for a developer between writing a browser-based application in Java versus writing that app directly in JavaScript?
  • What are the GWT compiler's current limitations in translating Java code to JavaScript?
Well worth a look!

No comments: