I'm going out on a limb and assume someone has already considered a ClojureScript JVM backend? Or is there some other strategy for moving towards self-hosting?
Not a high priority since Clojure on the JVM works just fine. However a lot of the activity around ClojureScript is necessary work for Clojure-in-Clojure. For example it's the first time a large number of the efficient persistent data structures have been written in Clojure itself.
Makes sense. Better to make more things instead of rewrite the compiler without good cause. I'm just surprised it hasn't happened earlier, since that's the approach many new languages take. But Clojure is pragmatic, so I really shouldn't be surprised.
I read this comment, waited for 10 minutes for smarter people than me to comment. Now I'll bite.
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?
Bootstrapping and consistency across platforms. The goal of Clojure-in-Clojure is to write the Clojure compiler in as much of Clojure itself as possible. Right now the ClojureScript compiler is actually closer to this goal than the Clojure compiler.
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.
My view on clojurescript to javascript that implementation has significant benefits mostly if targetting mature javascript library (such as dojo toolkit or others)
I do not think it is support right now but would be nice to be able to do things like
This is hugely exciting, but I'm really hoping that someone comes up with a satisfying solution to the conditional compilation problem soon. It'd be pretty depressing if the only things that were portable between implementations were algorithms.
I also hope for a good solution. I disagree about portability though.
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.
I think we do actually agree. I just want it to be possible to have cross-platform libraries, not it to be mandatory. But it would be nice if, for instance, sql libraries were portable as long as you weren't doing anything unusual.
So what is it like trying to debug something you've written in clojurescript? Regardless of the backend target language, it seems so disconnected. Is there a REPL for clojurescript?
If you know JavaScript and Clojure debugging ClojureScript is not terrible. That of course is still far too high a bar for most people.
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.
I am excited that ClojureScript could be used to target multiple backends, allowing one to leverage the platform's benefit's as needed.