by kbd · 7y ago · 0 comments
The JVM /= Oracle JVM by the way. There is OpenJDK
EDIT: Also I think recent Java releases have gotten into making self contained binaries (which just means they package the JVM...it's in there, it might jump out and bite you!). But, as long as you are careful what you are shipping, packing up a JVM has always been an option
Kotlin has Kotlin/Native, so I was hoping there might be a similar initiative for Clojure. But, a few reasons:
* Startup time
* Ability to deploy/share a binary
* The JVM just seems so "heavy" to me. It's certainly the only language runtime I know of that runs a persistent helper app, or asks to install an Ask toolbar upon installation.
* Bias against Oracle and Java
> Also I think recent Java releases have gotten into making self contained binaries
TIL, thanks.
Edit: edited.
There is also a lein (clojure build tool) plugin for this at https://github.com/taylorwood/lein-native-image
It's always fascinating when I encounter people with opposite biases to my own. While I'm no fan of Oracle, I seek out technologies that are based on the JVM and try to avoid things based on many other technologies because I intrinsically trust certain behaviors and features of the JVM that other ecosystems lack.
Java is not as bad as you think. Clojure does takes a little longer though
> Ability to deploy/share a binary
there are jar files, but I know what you mean.
Interesting work happening in GraalVM land: https://www.innoq.com/en/blog/native-clojure-and-graalvm/
> Bias against Oracle and Java
yeah, well ... we're all biased. It helps us make decisions quickly ;)
For example, I have a Python script[1] that runs on each command prompt to print status about my current git repository. Just timed it, it runs in .08-.12 seconds within a repo and about .02s outside of a repo. I still want to rewrite it in C using libgit2 someday, but something like that would be unusable if it was written in Clojure.
[1] https://github.com/kbd/setup/blob/master/HOME/bin/repo.py
Wouldn't any replacement need just as much "weight"? The GraalVM example (linked elsewhere) turns a 300KB Java program into a 25MB standalone binary. The JVM provides a lot of features, and they don't come free. That's why he chose it.
no, it typically doesn't. in certain edge cases the JVM does out perform Graal though.
Can do NodeJS with Clojure a’la Clojurescript as well
That said, if you're looking to get into the Clojure ecosystem in general, almost certainly not the place to start. You miss out on the multitude of good OSS libraries that have Java deps.
Looks like last update 3 days ago.