Fork me on GitHub
#graalvm
<
2020-08-22
>
chris44120:08:11

Is it possible to build a clojure native app that doesn't have initialize-at-build-time? Stepping back I would like to use xgboost and xerial-larray, both of which have jni bindings and it appears from graalvm-native's documentation this is possible but there appear to be static initialization issues. So if there is a known example, java or otherwise, of someone using libraries that use JNI that may also help a bit.

chris44120:08:08

Also, I know that there is a solid pool of documentation about using graal native with Clojure. Where are those docs?

borkdude20:08:45

Check out the topic of this channel

borkdude20:08:10

@chris441 I have a couple of examples that use JNI. E.g. https://github.com/borkdude/clojure-rust-graalvm. https://github.com/epiccastle/spire is also one.

chris44120:08:32

Awesome, thanks

borkdude20:08:19

@chris441 As for static initialization issues: you can make exceptions for specific classes, e.g. https://github.com/babashka/babashka-sql-pods/blob/5d04e7fce699741e1b5e8488cf0a8f70843a3e2e/script/compile#L60

chris44120:08:36

beautiful 🙂.

chris44120:08:53

clojure-rust is also a pathway I have looked at before but using JNA or JNR...neither of which work (for good reason) in graal native

chris44120:08:43

Also, sql bindings....really nice. That was going to be a question soon.

chris44120:08:52

Do you have a replacement for sun.misc.Unsafe?

borkdude20:08:07

I've never used that class, sorry