Tuesday, January 23, 2007

Java to JavaScript Compilation with AJAX and Spring Integration

A nice article by Ben Alex on Java to JavaScript compilation. In this post, the author explores a new open source Java to JavaScript compiler named Java2Script Pacemaker (J2S), presents an initial Spring integration, and compares J2S with existing compilers such as Google Web Toolkit (GWT) and Open Laszlo. According to the author "J2S is currently differentiated from GWT in several broad ways. The first is its compiler technology, which builds on Eclipse Abstract Syntax Tree (AST) and therefore requires Eclipse. However, Eclipse JDT Core supports a headless mode and thus it wouldn't be difficult to execute J2S compilation from an Ant plugin or Maven mojo. The second difference is that J2S provides comprehensive runtime reflection and widget binding capabilities. GWT prefers compile-time JavaScript optimisations, at the expense of these runtime services. J2S – on the other hand – recognises that a combination of Moore's Law, improved browser JavaScript interpreters and JNI-like JavaScript optimisations collectively provide scope for adequate performance, whilst still enjoying fuller JRE emulation and other runtime services."

No comments: