I'm starting to hack on the Clojure compiler (class clojure.lang.Compiler) to emit simplified Java source in parallel to the usual bytecode. Simplified in the sense of every namespace being a single class, functions being methods of that class etc.
This loses much of the dynamic nature of Clojure namespaces but it should make the result much more efficient for GWT to compile to Javascript. At this point I just want to get Clojure code translated to JS and I am not trying to implement a REPL, reader or compiler that will run in the browser.
I drew this diagram of the AST that the compiler uses internally to get a feel for the size of the problem. Of course, this does not take the runtime support into account. That is a whole other aspect that I am afraid to think about at this point.
Saturday, September 4, 2010
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment