This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-03
Channels
- # announcements (15)
- # babashka (143)
- # babashka-sci-dev (2)
- # beginners (35)
- # biff (11)
- # calva (5)
- # cider (8)
- # clerk (4)
- # clj-kondo (58)
- # cljdoc (6)
- # clojure (88)
- # clojure-denmark (1)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (16)
- # clojure-uk (1)
- # clojurescript (19)
- # clr (32)
- # code-reviews (158)
- # datahike (5)
- # datomic (10)
- # deps-new (3)
- # fulcro (12)
- # graalvm (20)
- # honeysql (23)
- # hyperfiddle (32)
- # kaocha (17)
- # membrane (6)
- # observability (1)
- # other-languages (2)
- # pathom (5)
- # practicalli (12)
- # reagent (4)
- # reitit (7)
- # releases (1)
- # sci (25)
- # shadow-cljs (52)
I want to explore using GraalVM to build out a little CLI app and am curious about having several JVM's on my system. I'm using Temurin-17.0 right now and would like to keep that as my default. Can I install Graal, use it to bundle up my app, then get back to Temurin pretty easily or is this a big hassle? I'm using Debian
I usually just download GraalVM in my Downloads folder and write a script that takes into account the above GRAALVM_HOME env var
Here is an example how I write a graal CLI build: https://github.com/borkdude/clj-native-sound-demo/blob/857fa5124267e93d36fff86db85b645ce784376a/bb.edn#L5-L10
It is small. Does babashka work with clj-http? For some reason I was having issues with http-kit
I have the following in my .bash_profile
function graalvm() {
export GRAALVM_HOME=/Users/adrian/workspace/graalvm/graalvm-ce-java19-22.3.1/Contents/Home
export JAVA_HOME="$GRAALVM_HOME"
export PATH=$JAVA_HOME/bin:$PATH
java -version
}
You can switch to using the graalvm jvm just by typing:
$ graalvm
You could set it up to restore, but I just close that terminal and start a new one 😄
Also, I almost never find the need to "get back" since GraalVM works perfectly fine as a normal JVM as well
> It is small. Does babashka work with clj-http? For some reason I was having issues with http-kit No, but it has https://github.com/babashka/http-client which is built on the java.net.http package
Compiling native-image
can be fairly slow though. Because of that, bb
and friends is a great place to start since it's precompiled.
Yeah I'm going to give bb
a shot since I've wanted to get some experience with it anyways. That built in http-client
looks perfect for my simple needs
in bb, cheshire.core
is the built-in json library. clojure.data.json works from source, but it's slow if you have big payloads since it's interpreted.