4 ms·
I always thought the Java tie-in was a double-edged sword. For some potential Clojure users, in addition to learning the language they were interested in, they'
by frou_dh 9y ago
I always thought the Java tie-in was a double-edged sword. For some potential Clojure users, in addition to learning the language they were interested in, they'd also have to half-learn a language (and its tooling) that they probably weren't interested in.
I guess in the US there is/was an assumption that everyone coming out of the computing education system is already experienced with Java.
- derefr 9y agoI 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.
- rjeli 9y agoI can't find the quote for the of me, but it was from Rich Hickey and went something like: "First, you use Clojure to escape Java. Then, you use Clojure to write better Java." I definitely found it to be true. Clojure takes the good parts of Java's OO system.
- cutler 9y agoDoesn't make any sense as Rich makes a big point of having wasted years writing large applications in Java and C++ before discovering Lisp and FP. If anything Clojure is the ultimate anti-OOP which, I think, partly explains its lack of adoption sitting, as it does, on top of a mass of libraries designed with OOP.
- rjeli 9y agook, found it: https://stuartsierra.com/2008/08/08/clojure-for-the-semantic-web https://stuartsierra.com/2008/08/08/clojure-for-the-semantic... I think it was in reference to the java ecosystem, more than "a better way to write java," although I still see it that way.
- cutler 9y agoHow can Clojure be reduced to "a better way to write Java" when you can live quite happily in Clojureland without writing a line of Java or importing a Java library?
- dragonwriter 9y ago> Clojure takes the good parts of Java's OO system. Such as?
- rjeli 9y agoProtocols from interfaces and multimethods from overloading. Although, to be honest, I've barely ever used them because FP is so easy in clojure. The few times I have, they make sense.