
Angry Birds' Cross-compiled Java Versus Native JavaScript - DanielRibeiro
http://css.dzone.com/articles/web-gaming-technologies-angry
======
mcdaid
I was blown away by the google IO session. The idea of writing a game in Java
and then having it converted to multiple formats, javascript/canvas/webgl,
flash, android.

Quite amazing!

If they could add conversion to run on apple devices then this could well be a
glimpse of the future.

~~~
freakwit
Illumination Software Creator: <http://radicalbreeze.com/>

Target Flex, Android, iOS, maemo... in a visual "block" environment.

I haven't tried it myself, but could be useful for you. It's available in the
ubuntu software centre as well.

------
nl
This is a stupid article title as it makes it sound like it is Java vs
JavaScript.

GWT compiles to "native JavaScript". There is _no_ "versus" to be found -
using GWT is just one development tool/style.

It would be better to tell people to explore the Google IO session videos. All
the information is there, in a form that is actually informative.

~~~
ZoFreX
If you read the article it wasn't compiled with GWT, but with "ForPlay" which
can cross-compile the game written in Java to desktop Java, webapp (via GWT),
Android or Flash.

~~~
nl
Actually, I think forplay would be best characterized as a specialized
library, dependent on GWT, with other backend compilers that also depend on
GWT.

See, for example the instructions:
<http://code.google.com/p/forplay/wiki/GettingStarted> (note how it's the GWT
toolchain)

Issues like <https://code.google.com/p/forplay/issues/detail?id=12> show how
the GWT is used to build the Flash version

Still not convinced?

flash.gwt package:
[https://code.google.com/p/forplay/source/browse/#svn%2Ftrunk...](https://code.google.com/p/forplay/source/browse/#svn%2Ftrunk%2Fcore%2Fsrc%2Fflash%2Fgwt)

or

[https://code.google.com/p/forplay/source/browse/trunk/core/s...](https://code.google.com/p/forplay/source/browse/trunk/core/src/forplay/flash/FlashStorage.java)
uses om.google.gwt.core.client.JavaScriptObject

same class: private native String get(JavaScriptObject data, String key) / _-{
// TODO Auto-generated method stub return data[key]; }-_ /;

(Note the GWT convention for "native" code to be used by the
Javascript/Actionscript runtime)

Edit: also Joel Webber & Ray Cromwell are both on the GWT team at Google so it
makes sense they'd use that toolchain.

------
sjs
Quick, someone run it through the Java -> JavaScript transpiler. We can go
deeper.

