Good news! The recently released https://www.graalvm.org/release-notes/JDK_25/ also supports FFI/FFM (https://www.graalvm.org/jdk25/reference-manual/native-image/native-code-interoperability/ffm-api/)! @andersmurphy @suskeyhose This opens up a whole new world 🙂
I've been trying to play around with this to get it working in bb, but I'm stuck on finding a small self-contained Java or Clojure example that does something with Panama. Do you have such a thing?
it's not "small", but it is self contained and is real
as for a small little thing, one moment. I'll write one
I made a graal test here: https://github.com/borkdude/graal-repros/blob/panama-ffi/Repro.java
it fails with some message about a config file though
which is probably totally fixable but busy with something else right now
Awesome, having full FFM support means I can finally look into the plans I had started on for making coffi support it.
also as for sqlite4clj, that uses coffi, which needs a bit more stuff that I have to work out for graal's native image, because coffi uses runtime bytecode generation by default
Specifically: there's some serious challenges around function pointers because coffi uses runtime bytecode generation to handle the boxing and unboxing requirements of the different types of handles.