3 ms·
While modern JVM languages leverage Java to overcome the 'library problem', the traffic tends to be one-way. So while there are 'clojurely' ways to call Java li
by _sh 15y ago
While modern JVM languages leverage Java to overcome the 'library problem', the traffic tends to be one-way. So while there are 'clojurely' ways to call Java libraries, calling Clojure from Java is ugly and non-idiomatic, despite what the article claims. How does one even call Scala from Clojure?
Presuming that, for the most part, developers migrate from Java to a different JVM language, then inevitably these languages will fragment code written for the JVM, devaluing the very foundation used to hoist the languages into usefulness in the first place. The tower of Babel will rise higher with competing idiomatic implementations of various libraries. This is not a bad thing--rather it has to be this way because introducing new language features (such as STM in Clojure's case) demands it. We're living in a gold rush on Java to mine it for its libraries. After this will come a period of settlement as each JVM language builds its own community, with civic structures that perform the same duties, but look different, in every town square.
- bokchoi 15y agoWhat will help interop between languages is something like Atilla Szegedi's MOP: http://www.wiki.jvmlangsummit.com/MOP_and_Invokedynamic http://www.wiki.jvmlangsummit.com/MOP_and_Invokedynamic It's a pretty clever usage of invokedynamic.
- arohner 15y agoCalling Clojure from Java is ugly, but calling Clojure from JRuby is quite pleasant, and I'm pretty sure a nice Clojure library could be written for calling JRuby from Clojure. Calling Clojure from Java is difficult because Java is inflexible more than some inherent weakness in the "bootstrap on a host VM" strategy. I've written a library to call Clojure from JRuby. It's about 100 lines, and took me an afternoon. I assume the situation is similar all high level JVM languages. Given all the above, I agree that the JVM languages will fragment somewhat, but to a lesser degree than you seem to think. If there are any really killer app libraries in one language, it won't be too hard to integrate them into the other languages.