Sunday, April 19, 2009

NoMoreJs Scooped?

The concept of language translation between a modern Object Oriented language and a lower level language has been here a long time. That's what compilers do. In this short post, i'll review some tools that translate your code to the beloved JavaScript language.

A friend commented on my last post, (re-) introducing me to GWT. Apparently, I've been asleep and that's what Google has been doing for some time with Java to JavaScript conversion. However, GWT is a JavaScript framework by its own, so there is a tight coupling between the compiler and its target platform.

Then, more research has found out JSC, which is even crazier than GWT. Instead of converting a modern language, it translates MSIL instructions to JavaScript. It appears to me like a Reflector plugin that exports JavaScript (hey! that's not such a bad idea).

But the real gem that I found was Script#. Apparently, Microsoft has been using this for a couple of years now. It supports JQuery as a target platform, and really looks advanced with all the bells and whistles. It's closed source (how surprising), and apparently pretty popular outside the Redmond Giant.

CodeRun's compiler, while not really advertised, is far more advanced than all of the above. The generated code requires a really thin stub, but in return you get a Type System that supports generics, debugging, profiling, and native remoting. However, right now the type compiler is coupled with the type system and remoting stub. I want plain-vanilla JavaScript.

So I'm still gamed. Writing compilers is fun!

No comments: