graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
ghadi 2020-01-31T14:37:01.033300Z

does native-image handle Java 11 yet?

borkdude 2020-01-31T14:42:34.033500Z

it does

borkdude 2020-01-31T14:43:28.033900Z

@ghadi https://github.com/graalvm/graalvm-ce-builds/releases, you'll need to download one that says java11

borkdude 2020-01-31T14:45:43.035100Z

there is however an issue with clojure + jdk11 when you use Reflector.java. It has a piece of dynamic code that dispatches between 8 and 11 based on some runtime value which confuses the svm analyzer. I worked around that just by copying Reflector.java and removing that dynamic code: https://github.com/borkdude/sci/blob/1294b17d402bfed519289990648cb01c45e8e3a8/reflector/src-java/clojure/lang/Reflector.java#L29-L43

borkdude 2020-01-31T14:47:03.035600Z

I'm still not using JDK11 for anything GraalVM at the moment, just fyi

borkdude 2020-01-31T14:53:25.036200Z

any specific reason you would want to use jdk11, or just curious?

alexmiller 2020-01-31T14:55:17.036700Z

I'm guessing the new http client :)

ghadi 2020-01-31T14:55:18.036900Z

curious about making stuff with the built in http://java.net.http client

alexmiller 2020-01-31T14:55:23.037200Z

I win!

ghadi 2020-01-31T14:55:35.037500Z

yeah -- gets rid of a bunch of dependencies

borkdude 2020-01-31T14:59:26.038600Z

if you need an http client in a graal binary, you can also use clj-http-lite which has no other dependencies: https://github.com/borkdude/clj-http-lite/blob/fa277d8264b061db8ae9b4fc117b74b1fc2d93ce/project.clj#L7

borkdude 2020-01-31T14:59:40.039100Z

(but it doesn't do async like the JDK11 one I think)

borkdude 2020-01-31T15:00:19.039500Z

it uses HttpURLConnection

borkdude 2020-01-31T15:00:50.039700Z

https://github.com/taylorwood/clojurl also uses clj-http-lite