3 ms·
I feel like Clojure is more of a language that just happens to exist in the same package ecosystem as Java, and which offers a good syntax for fluently calling
by derefr 9y ago
I feel like Clojure is more of a language that just happens to exist in the same package ecosystem as Java, and which offers a good syntax for fluently calling into the APIs those packages offer. Like Elixir with Erlang, or Rust with C.
You don't really need to know Java to write Clojure, though you do need to know things about the JVM and about the particular (Java) types that the JVM's reflection and concurrency primitives are built on. Just like Elixir still requires you to understand BEAM and OTP primitives, or Rust still requires you to understand the "C Abstract Machine" and (usually) POSIX primitives.
In at least the Clojure and Elixir cases, I don't think the runtime was chosen because anyone was expected to be familiar with the relevant abstract/virtual machine; they were chosen because BEAM and the JVM are just well-engineered VMs that have decades of research and bug-fixing and stress-testing put into them, and it's a "free win" for your language's production-readiness if you build on such a runtime. Interoperability with existing code in that ecosystem is also nice, but secondary; people using your language want to use your language, after all; if they wanted the best interoperability with Java, they'd just use Java.
(In the Rust case, [zero-overhead] interoperability with C code really was the paramount concern; but still, that's interoperability with existing C code, not the expectation that anyone would want to "take advantage of C" by writing hybrid Rust/C projects. If you're using Rust, you probably want to be writing Rust, not C.)
- frou_dh 9y agoYeah - I didn't mean to imply that that was Hickey's main motivation for the tie-in. Ultimately the sheer real-world prevalence of Java might make my original gripe irrelevant. You say you don't really need to know the de-facto language of such "host" platforms, but that strikes me as putting a developer into a rather fussy and boxed-in posture if they're going to try and use the NewLang seriously/professionally.