graalvm

Casey 2025-09-25T10:07:35.524259Z

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 🙂

🎉 2
borkdude 2025-09-25T10:11:25.338909Z

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?

Casey 2025-09-25T11:38:14.418529Z

https://github.com/andersmurphy/sqlite4clj perhaps?

Casey 2025-09-25T11:38:30.648059Z

it's not "small", but it is self contained and is real

Casey 2025-09-25T11:41:50.280729Z

as for a small little thing, one moment. I'll write one

borkdude 2025-09-25T11:42:31.117149Z

I made a graal test here: https://github.com/borkdude/graal-repros/blob/panama-ffi/Repro.java

👍 1
borkdude 2025-09-25T11:42:41.505299Z

it fails with some message about a config file though

borkdude 2025-09-25T11:42:57.943739Z

which is probably totally fixable but busy with something else right now

2025-09-25T13:54:37.265419Z

Awesome, having full FFM support means I can finally look into the plans I had started on for making coffi support it.

2025-09-25T13:56:36.987419Z

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

2025-09-25T13:58:43.946809Z

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.

🙏 1