Is GWT's compiler java->javascript or java bytecode -> javascript?

644 views
Skip to first unread message

Mathijs

unread,
Jul 20, 2009, 11:03:14 AM7/20/09
to Google Web Toolkit
Hello,

I would like to know at which level gwtc works. Is it purely at the
source level (.java) or more low-level (bytecode)?
I'm a ruby developer, using jruby (which runs on JVM). jruby is able
to compile ruby code to .class files. Also, I'm able to interact with
other java libraries, so in theory, I should be able to use the GWT
classes from ruby.
I would like to use GWT, but I don't want to switch to java. If GWT's
compiler would be able to process the .class files jruby creates for
me (without having a .java source file) this would be very cool.

Googling didn't turn up much for this subject so I'm affraid I'm out
of luck.
Thanks for any help
Mathijs

Paul Robinson

unread,
Jul 20, 2009, 1:42:24 PM7/20/09
to Google-We...@googlegroups.com
It uses the source code, not the bytecode. It can't be made to work at
the bytecode level for various reasons.

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/d19dd5769e993f63/3418f999d1536f57


Paul

Sumit Chandel

unread,
Jul 23, 2009, 2:01:02 PM7/23/09
to Google-We...@googlegroups.com
Hi Mathijs,

The reason why the GWT compiler works from Java source instead of bytecode is because of all the extra information we get from source that can be used in cross-compile optimization when going from Java to JavaScript. As the thread Paul pointed to indicates, it is possible to work from bytecode, but might not be ideal when you want to go for maximum code optimization / minification in the final JavaScript artifact.

Hope that helps,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages