I took a different path to Clojure/ClojureScript, coming from a dynamic language background. Java was foreign to me too, but perhaps in a fundamentally different way. That said, I think the experience is probably very similar so I’ll share mine as it relates (but I’m not speaking for the author).
Clojure (the JVM runtime variant) is not compiled to JVM bytecode. It’s compiled to Java implementations. This detail isn’t very hidden, and few affordances are made (or were when I worked in Clojure) to accommodate the indirection when something goes wrong. When you get an error, you’re now walking down this stack:
0. Debugging the build (which has all of these steps before you might even run code)
1. Debugging your own code
2. Debugging Clojure source written in Clojure
3. Debugging the Java implementation of Clojure
4. Debugging Java’s runtime behavior
Most often, Clojure the language doesn’t do anything to make step 1 or 3 any easier. It’s just a call stack from whatever .clj source into a Java stack with no context whatsoever.
This is incredibly hard to debug, especially because a lot of other important details are hidden. For instance:
(let [foo {…}] …)
Calls one of several kinds of HashMap implementations, and may call many others in the course of processing foo. All of these dump you into Clojure, the runtime.
ClojureScript is fundamentally the same, except:
- It’s got a whole additional runtime to loop through
- The cljs maintainer is (or was when I was writing cljs) actively hostile to offers to contribute changes which would make this less painful. Literally close as wontfix, rejecting offers to contribute
Nearly 100% of these experiences are leaky language host marginalia (ie type errors caught in an unhelpful place at runtime). And I wanna be clear: I love the concept of Clojure and don’t regret any of the time I spent working in it (though I do regret some time with cljs). But the probability of encountering incredibly confusing host language stuff very quickly approaches 1 if you’re developing actual things for real users. And then it gets really “hope you have a good mental map in memory” really fast.