Hacker News new | ask | show | jobs
by Scarbutt 1670 days ago
Not writing Java (although you do have to do lots of interop with Java).
3 comments

It's true it's "not writing Java", that's true for every language besides Java! But the second part is definitely not true. First, you can very much use JVM Clojure without touching Java, I've done so many times. Secondly, you can use ClojureScript which cannot even do interop with Java since it "compiles" to JavaScript and doesn't run on the JVM. Thirdly, you can use Babashka to run Clojure code with GraalVM and SCI instead.

Many options exists to not having to touch Java when you use Clojure, but I guess it's hard to kill old memes?

If you are writing toy programs in your mom's basement sure but every real world clojure project I have work with had to use Java libraries.

When I said 'not writing Java' I was obviously talking about the JVM.

> If you are writing toy programs in your mom's basement sure but every real world clojure project I have work with had to use Java libraries.

That's OK, most real world Clojure and ClojureScript projects I've worked on didn't had to use Java libraries, maybe 10% of them had to have Java code or used Clojure-wrapped Java libraries. Everyone's experience is different :)

> When I said 'not writing Java' I was obviously talking about the JVM.

Yeah, that's not super obvious as normally people consider Java the language to be something else than JVM the runtime.

I've seldom had uses for Java interop, once in a blue moon. An exception is FP math functions and constants, using those from java.Math via interop instead of having a native math library has been the Clojure way (but seems getting a native wrapper in Clojure 1.11, clojure.java.math).
Then using the JVM to start with isn't really the cleverest decision.