Hacker News new | comments | show | ask | jobs | submit login

I've had the same curiosity. The GWT compiler essentially parses the Java source code and uses a series of complex rules to convert it to JS. This is why whenever you use any client side libraries you must have the source code itself rather than just the binaries. If the source code cannot be parsed directly, it cannot be converted to JS.

In order for GWT to work for other languages it would need to be totally rewritten, unfortunately. That is unless you could somehow write an adapter for the core GWT JRE emulation library (java.lang & java.util classes). But like you say if the language your adapting to the Java code is not statically typed, you will have a hell of a time b/c the compiler is based on the assumption that the language is still java and therefore static. Like you say, you might end up having to force the programmer to follow certain conventions. Like always naming certain datatypes a unique way, so your adapter could map it back to specific static Java datatypes. But then doing this kind of defeats the purpose of using a dynamically typed language anyway..

Yeah my thoughts. Although I don't know if it impossible - GWT does work of an AST - no reason why other languages couldn't drive it. Perhaps the contenders would be scala (static) and JavaFX markup stuff (which is also static, and designed for UI).

I know its unpopular, but for GUI stuff I prefer statically typed code. It is more verbose, but I find GUI stuff really hard to test (even with friendly tools) and having the compiler do some more work for me I find saves time on silly errors when manually trying stuff out. Yes I type more (or my IDE does really), and I am doing the work for the compiler to some sense, but I find it easier then any other way I have worked for many years doing this.

Its actually ironic (in the alanis sense), I would love a good static typed GUI language, but a dynamic one on the server ;) Maybe my brain is backwards, but I haven't been convinced so far by anyone who has shown me they actually do anything with what they talk about.

I do like JavaScript the language, where its going, when it is removed from the browsers. I wouldn't be unhappy using it more (just less so for the GUI - well I am keeping an eye on where jQuery is going it seems about right as a general tool for front ends for me, but not yet).

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact