Hacker News new | ask | show | jobs
by andrewchambers 4124 days ago
I want to see a clojure clone embedded as a Go scripting language. The immutability means that the interpreter would be mostly threadsafe, and thus would support goroutines well.
2 comments

Embedding an immutable language in a mutable one is a recipe for awkwardness - how would you expose host-language things to the inner language? Better to do it the other way around - mutable scripting language embedded inside immutable host.
Clojure is an immutable language built on top of mutable hosts. Interop is handled beautifully. A go hosted Clojure (gojure?) would probably be fine.
Calling Clojure from Java is not remotely what I would call beautiful; it's a lot of Strings and pain (especially when you compare to calling Scala from Java). Calling Java from Clojure is substantially more elegant (it requires a structured FFI but Clojure is good at those).
I don't know if it would be an exact clojure clone, would need a few tweaks and the addition of native channels.
Well the closest I've found is https://github.com/zhemao/glisp which is similar syntactically, but doesn't have immutability.
otto + clojurescript would probably work, but would lack many features + thread safety.