4 ms·
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?
by dhconnelly 14y ago
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?
- darklajid 14y agoI 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?
- dhconnelly 14y agoRight. But the Clojure compiler is written in Java. See swannodette's comment on my comment. Apparently self-hosting isn't a high priority right now.
- rads 14y agoBootstrapping 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.
- swannodette 14y agoNot 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.
- dhconnelly 14y agoMakes 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.