LobstersSaturday · September 5, 2026FREE

Babashka 1.13.220 gets FFI

babashkafficlojure

Babashka 1.13.220 was released, adding a new babashka.ffi namespace that allows calling C libraries directly from Babashka scripts. The babashka.ffi library is also available as a standalone library for JVM Clojure. The API is experimental, though no changes are currently planned. Examples show loading system libraries like libz and OS-specific math libraries, and defining C functions with defcfn. The library builds on java.lang.foreign and requires explicit memory management through arenas, which provides exceptions rather than segfaults. It includes a 'place' concept for reading and writing structs and unions. The release also changes the default Linux binary to a mostly-static build, where glibc is the only dynamically linked part, to support FFI. A fully static binary remains available via the install script with the --static flag. The installer script probes for supported glibc versions and falls back to fully static when needed. Additionally, task improvements allow :exec-fn tasks to compose through :depends, with inherited options appearing in --help and shell completion, and support for :exec-args and :cmd trees via vars. Several demo projects and new FFI-based libraries (babashka.sqlite, babashka.duckdb, babashka.postgres, filewatcher) validate the design.

// why it matters

Babashka scripts can now call C libraries directly, enabling new integrations without separate processes.

Sources

Primary · Lobsters
▸ Read original at blog.michielborkent.nl

Like this? Get the next digest.