开发者

convert scala to java for GWT?

开发者 https://www.devze.com 2023-03-02 05:07 出处:网络
For GWT client side you need Java source code so i got that idea to convert scala code to java code. How can i archieve this conversion?

For GWT client side you need Java source code so i got that idea to convert scala code to java code.

How can i archieve this conversion?

Or is there a production ready possibility to use scala directly?

Thanks for开发者_如何学JAVA any help!


It can't be done because Scala compiles directly to byte code, not Java. Compiling to byte code is much easier than generating Java and besides, there's a lot of stuff the byte code allows that is forbidden by Java the language, such as not declaring checked exceptions.

There's a project going on at http://scalagwt.gogoego.com/ to generate a "java-like" language from Scala that GWT can read. It seems to be moving along nicely and I know Lex Spoon is involved with it. I know they briefly considered the other possibility of decompiling the generated Java but dropped that path quickly after determining that too much information was lost in that process.

If you only want to use Scala on the backend and write the client in Java, that's always been possible and works fairly well in Eclipse.


Some work has been done to allow GWT to be written in Scala, by an intern on the GWT team last summer. See http://www.youtube.com/watch?v=_1GjgFjX5gE

0

精彩评论

暂无评论...
验证码 换一张
取 消