Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With the ability to reach Java, JavaScript, .Net, and Erlang runtimes, plus interop with many other languages via GraalVM, Clojure has incredible reach across runtimes, perhaps more than any other modern programming language, certainly among Lisps. That said, its pretty gnarly to try to navigate all of the implementation differences among platforms. I wonder if there is a subset of Clojure that is 'safe' to run on any of its supported environments.

This list is pretty long: https://clojerl.github.io/differences-with-clojure/

For now, the JVM is the only way to get the full Clojure experience.



The Clojure community believes strongly in the idea that it is a hosted language, and therefore prioritizes maintaining the semantics of its host (whether that be the JVM, a JS engine, or some other VM) over independent, consistent semantics for Clojure itself.

That being said they've made some concessions to the fact that it would be really nice to have portable Clojure code with `.cljc` files, but those are only portable Clojure code by matter of convention (the only technical thing `.cljc` files accomplish is allowing you to use reader conditionals).

Personally, I wish Clojure went further. Even with the commitment to being a hosted language, it still is clunkier at interop than Scala or Kotlin, two languages which nonetheless do have independent semantics as specified in their respective language specifications. It kind of seems you end up with the worst of both worlds (worse interop and no consistent semantics), although to be fair Clojure also commits far more heavily to the FP paradigm than Kotlin or even Scala, which makes it intrinsically more difficult to have seamless interop with Java (yes yes yes its interop with Java is already quite good, just not quite at the level of the others).


Yeah, I’ve developed some clj/cljs code. It’s full of conditional compilation. It’s even full of conditional compilation expressions in the ns header.


Don't fotget Hy (http://hylang.org).


It's great, but the differences between runtimes can be painful. In practice you still need your project to be aware of which Clojure code files are platform-specific and which are safe to run across all platforms.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: