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/.
katox 2020-04-24T08:47:37.186600Z

It won't be easy (even the pgsql supports only the happy path). Usually major lifting is done by java folks around frameworks like micronaut or quarkus or spring boot. Search their blogs for tips.

borkdude 2020-04-24T09:24:19.187200Z

btw, I have been able to get postgres support into babashka: https://clojurians.slack.com/archives/CLX41ASCS/p1587675201407300 more info here: https://github.com/borkdude/babashka/issues/372

borkdude 2020-04-24T12:50:57.187800Z

@peterschwarz Did you manage to get sqlite to work at all though?

peterschwarz 2020-04-24T13:07:44.188500Z

Not, yet, though I’ll take a look at your postgres work - it might give me some hints

borkdude 2020-04-24T13:13:25.189Z

postgres was by far the easiest to get going with graalvm, also because I found a working example from @yogthos

borkdude 2020-04-24T13:13:48.189400Z

mysql requires a sh*t-ton of reflection config and it still didn't work

peterschwarz 2020-04-24T13:14:23.190Z

same with sqlite, from what I’ve seen

yogthos 2020-04-24T13:14:25.190200Z

pg is the only one I could get jdbc to work with as well

peterschwarz 2020-04-24T13:15:07.191100Z

With sqlite, I think the biggest hurdle is getting it to load the native library

peterschwarz 2020-04-24T13:16:04.191900Z

Which, side question, is there any way to write those graal reflection classes using gen-class?

peterschwarz 2020-04-24T13:16:21.192600Z

Seemed like I was running into some classpath issues on that front

borkdude 2020-04-24T13:16:28.192900Z

@peterschwarz you don't need to generate classes, you just have to list them in a reflection-config.json file

peterschwarz 2020-04-24T13:16:33.193100Z

Ah

peterschwarz 2020-04-24T13:16:44.193600Z

Do those just go into a resources directory?

borkdude 2020-04-24T13:16:49.193700Z

you can also use an agent to discover those classes using a runtime example

peterschwarz 2020-04-24T13:17:08.193900Z

That’s cool

peterschwarz 2020-04-24T13:22:20.196200Z

I take it one is able to express the same thing with just those json files?

borkdude 2020-04-24T13:32:24.196400Z

yeah

peterschwarz 2020-04-24T13:33:24.196600Z

:thinking_face:

peterschwarz 2020-04-24T13:33:36.197Z

I’ll have to take another stab at this tonight…

wcohen 2020-04-24T22:03:44.199500Z

My primary struggle with this was that most libraries that have multiplatform natives embedded first copy the appropriate platform one to a temp directory and loadLibrary from there — I couldn’t figure out how to replicate that in graal at runtime. It may only work if sqlite or whatever exists on the system already, which is much less pain-free for the user

peterschwarz 2020-04-24T22:17:52.199900Z

Yeah, I’m definitely fine with that approach