Welcome! Please see the About page for a little more info on how this works.

+4 votes
in Clojure by

I still have not managed to try graalvm but as clojure user the question is, given the promise of graalvm, what are the problems if any with clojure integration on it and how is seeing upstream integration with graalvm? In term of tech and other aspects (I'm asking this question here to be tracked for later users)

2 Answers

+3 votes

I have created several apps with Clojure and GraalVM:


You can check those out to see what's currently possible and maybe not possible.

They work well with 1.10.1 with the caveat that you cannot require clojure.spec.alpha or clojure.pprint, because then you run into https://clojure.atlassian.net/browse/CLJ-1472. With 1.9.0 this problem isn't there, but I'd like to be on the newest Clojure possible.

What I found works well is: use leiningen to AOT your sources into an uberjar and then feed that .jar to GraalVM. I do this in all my GraalVM projects now.

It's worth pointing out that https://clojure.atlassian.net/browse/CLJ-1472 has been fixed with 1.10.1, I think!
+1 vote

I think currently you have to downgrade to Clojure 1.9.0 if you want to use native-image to generate a native binary out of graalvm (unless this has been fixed since I tried it)


Here's an example of using GraalVM and Clojure.


Hope it helps!
cool example, I was trying to build a CLI app to manage my books and I was very frustrated with the startup time. I tried GraalVM but at the time I could not make the HTTPS to work correctly because I needed to make some calls to Goodreads and Amazon APIs. Thanks for this example, I'll get back to that project soon.