Agile Ajax

Eight Javascript Code Generators

Javascript code generation seems to be here to stay, with GWT taking roots and Ruby providing it's RJS Templates. It seems like it's time for a roundup of the little critters.

  • RJS Templates for Ruby on Rails - Not quite a true Ruby->Javascript compiler as it seems to me, but cuts down on lots of coding.
  • GWT - Java->Javascript. Everyone has heard of this beast. It's the 800 pound gorilla sucking the air out of the room for many other frameworks. Unique in that it provides a "hosted" mode that lets you debug in Java rather than Javascript.
  • pyjamas - Python->Javascript. Open Source project inspired by GWT from which it borrows some ideas. Fairly active.
  • Morfik - Java, Basic, C#, Object Pascal -> Javascript. Commercial offering from down under (Tazmania, dontcha know). Comes as an IDE that also provides server side development capability.
  • Script# - C#->Javascript. No "hosted mode," so you are stuck debugging the generated Javascript. Runs out of Visual Studio. One man's effort right now, though that man apparently works for Microsoft. Unclear what the future of this project might be.
  • Java2Script - Java->Javascript. Eclipse plugin. Predates GWT. Has a set of widgets based on SWT. Claims to allow you to convert your SWT based desktop apps into Javascript-based web apps. The demos (see screenshot of one of them) look promising.
  • j2s.jpg
  • Scheme2Js - Scheme->Javascipt. If you feel the need to get that LISP-like syntax when you write code, here is the compiler for you. There's an article describing the inner workings for those interested.
  • Haxe - Haxe->Javascript. Haxe is an OO language used to write web applications, among other things. You can also use it to write Flash and server side apps. All in one language. Didn't I just see a resume for a Haxe developer here somewhere?

I'd only feel comfortable using RJS and GWT at this point, since RJS doesn't really "hide" the Javascript all that much, and GWT provides the hosted mode. If you are debugging a complex, generated hunk of Javascript, you'd better be able to either make sense of the code (RJS) or go back to the source language (Java in GWT). I'm surprised the other tools don't think to provide some sort of high-level language debugging capability. I guess too few developers these days remember what it was like to debug assembly language generated from a compiler.

There's also the ParenScript LISP->Javascript compiler, but it, alas, seems to have gone the way of all single developer open source projects. Last, there is this article from Microsoft Research about the implementation of an Oberon to Javascript compiler. An interesting how-to of how such a thing can be built. Sorry, just the article, no download.



Technorati : , , , , , , , , ,

Comments: 4 so far

  1. You missed http://jsc.sourceforge.net

    Comment by zproxy, Friday, September 15, 2006 @ 2:51 am

  2. And also you missed: ST2JS (Smalltalk to Javascript)

    http://www.squeaksource.com/ST2JS.htm
    http://diegogomezdeck.blogspot.com/2006/07/st2js-traductor-de-smalltalk.html

    Comment by Diego Gomez Deck, Sunday, September 17, 2006 @ 3:35 am

  3. ParenScript (Lisp->JS) has a new home:
    http://parenscript.org/

    Comment by Dave Benjamin, Sunday, September 17, 2006 @ 3:56 am

  4. Hi, one of my recent projects fits nicely in the category of JS code generators. It is Lisp front-end to JavaScript, offering compact Lisp reader, macroexpander and translator, all implemented in JavaScript:
    http://www.geocities.com/dmitrynizh/lisp.html. This web page loads the translator into the browser and provides many demos.

    Comment by Dmitry, Tuesday, October 23, 2007 @ 10:59 am

Leave a comment

Powered by WP Hashcash

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com