ClojureScript Lua backend
raphamiard.posterous.com
raphamiard.posterous.com
I am excited that ClojureScript could be used to target multiple backends, allowing one to leverage the platform's benefit's as needed.
What? Why? Clojure is a JVM language. The ClojureScript compiler _is_ running on the JVM (in Clojure). Why would you want to create a backend for the JVM for a language that tries to match a JVM language as closely as possible - and relies on the JVM for tooling?
I rocked back and forth for minutes. Please explain why you assume that someone considered this and why it wouldn't be nonsense?
If ClojureScript were ported to the JVM, maybe it would replace the current Clojure compiler as the official implementation. Clojure-in-Clojure would be further along, and implementations across host platforms would share a larger portion of code.
I do not think it is support right now but would be nice to be able to do things like
(use '[clojurescript-contrib.dojo_wrap :only (dojox.grid dojox.coolwidget)])
and the same for future Lua or other backends, however, I am not sure how the proposed modularisation will make this work.
It is awesome to have different dialects of clojure, which are the same wherever possible, and vary only where they have to.
The purpose of a different dialect is to take advantage of a different host vm/language. Enforcing uniformity across all dialects would preclude this.
But my point is, even accounting for variations, having a uniform representation for programming primitives across all these hosts is a huge win.
Its great that I'll be able to play with, take advantage of Lua without learning the details of its language. Instead of learning new syntax and semantics, all I need to know is the precise details of how this clojure dialect is different. This is much easier and more accessible than starting from scratch. I don't want to have to learn these languages in order to use them.
Finally, given the trend towards declarative representation, I expect a lot more than algorithms to be portable. I expect all the clojure dialects will be pretty interoperable from a SOA perspective.
EDIT: answered my own question about the repl: https://github.com/clojure/clojurescript/wiki/The-REPL-and-E...
In the case of JavaScript there's a rich set of existing debugging infrastructure tools that we can build upon. Also source mapping support is just around the corner for WebKit based browsers. That will improve the debugging story quite a bit.