graalvm

mauricio.szabo 2024-09-12T00:27:21.172919Z

Folks, does someone was able to compile a Clojure code for native-image without using a Java "companion file"? Basically, I wanted to write all my code in Clojure only. My attempt was trying to use gen-class with the right signatures like org.graalvm.nativeimage.c.CCharPointer, but when I run lein uberjar it crashes with

Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445).
org.graalvm.nativeimage.c.CCharPointer

phronmophobic 2024-09-12T00:36:13.979829Z

I assume you're trying to compile clojure as a library rather than an executable so you can expose some clojure functions?

phronmophobic 2024-09-12T00:37:26.673249Z

I use dtype-next to do all the dirty work, https://cnuernber.github.io/dtype-next/tech.v3.datatype.ffi.graalvm.html#var-expose-clojure-functions

mauricio.szabo 2024-09-12T01:10:58.280219Z

Yes, I'm trying to compile as a shared library