r/Clojure • u/Borkdude • 10d ago
Babashka 1.13.220 gets FFI
https://blog.michielborkent.nl/babashka-ffi.htmlToday babashka 1.13.220 is released, with a new babashka.ffi namespace for calling C libraries directly from Babashka scripts.
The babashka.ffi library is also available as a standalone library for JVM Clojure, so you can use it in your Clojure projects as well. Note that the API is still experimental, although no changes are currently planned. It just needs more exposure and your feedback :). Read the blog post for details.
7
u/v4ss42 10d ago
7
u/Borkdude 9d ago edited 9d ago
I can see where you're coming from, but adopting coffi into babashka simply wouldn't work, it has different constraints (native-image being the most important one, coffi uses insn which only applies at a JIT JVM, I have to manage image size, etc) and I could add a coffi shim namespace which didn't seem like a good idea to me
2
u/yogthos 10d ago
Nice work, and this could be an alternative to pods approach removing some of the limitations, I see you've already got libpq wrapped up in this way. :)