5 ms·
Why? Just curious. I've found the JVM to be surprisingly stable and great to work with.
by drikerf 4y ago
Why? Just curious. I've found the JVM to be surprisingly stable and great to work with.
- ARandomerDude 4y agoI love Clojure but the JVM is admittedly resource hungry.
- drikerf 4y agoI haven't found that to be an issue. For small programs there's also babashka.
- djha-skin 4y agoSuper long startup times and large binary size are what turned me off. This is clojure specifically not jvm specific. I find the JVM to be fine, but when I looked for another lisp I did want one that was compiled just because it was easier to distribute my programs.
- didibus 4y agoYou can compile it to a native binary, then you get super fast startup times and small-ish binary sizes.
- djha-skin 4y agoI invite you to try it. Put together a modest CLI that does SQLite, some network calls, and unzips files. ( https://github.com/djhaskin987/zinc https://github.com/djhaskin987/zinc ). Using native-image with any reasonable set of dependencies like this is *horrendous*. Just because you can doesn't mean it's tractable. I spent 10% of my time writing the tool and 90% of it trying to get it to compile. Absolutely the worst experience trying to get something to build in my life, and I'm a devops engineer. Building and shipping code is my thing.
- didibus 4y agoYa, I'm not going to disagree, it's not the nicest build pipeline. That said, you can figure it out normally. Using native dependencies will always be the hardest. I'd recommend first trying to use graalvm friendly libraries, and if not, libraries that are pure Java and don't have native dependencies. For SQLite for example, you have to include the SQLite C driver, and that's where it gets a bit complicated. See here for a demo build that includes SQLite: https://github.com/ericdallo/sqlite-graalvm-sample/tree/master/resources/META-INF/native-image/sqlite-graalvm-sample/sqlite-graalvm-sample https://github.com/ericdallo/sqlite-graalvm-sample/tree/mast... The most friendly way is to rely on this: https://github.com/clj-easy https://github.com/clj-easy It lists Clojure native image friendly libraries you can use. And it also includes some pre-configured dependencies you can depend on that will bring the correct build config. Then just pretend like there are no other libraries yet for this "new" language. Or learn about the native image process more deeply and contribute to the effort to add easier support for more libraries.