<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn" -->

---
title: Babashka 1.13.220 gets FFI | daily.dev
description: Babashka 1.13.220 introduces babashka.ffi, a new namespace for calling C libraries directly from Babashka scripts, also usable standalone in JVM Clojure...
canonical: https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Babashka 1.13.220 gets FFI | daily.dev
og:description: Babashka 1.13.220 introduces babashka.ffi, a new namespace for calling C libraries directly from Babashka scripts, also usable standalone in JVM Clojure...
og:url: https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn
og:image: https://api.daily.dev/og/posts/ksWe0RUqn.png
og:image:alt: Babashka 1.13.220 gets FFI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Babashka 1.13.220 gets FFI

**[Lobsters](https://daily.dev/sources/lobsters)** · 4 min read · 0 upvotes · 0 comments

## Summary

Babashka 1.13.220 introduces babashka.ffi, a new namespace for calling C libraries directly from Babashka scripts, also usable standalone in JVM Clojure projects. The API is experimental but stable, built on java.lang.foreign with explicit arena-based memory management (giving exceptions instead of segfaults). Demos show loading libz and libm, defining C functions with defcfn, and even defining Clojure functions inside SQLite via the new babashka.sqlite library. On Linux, the default binary now flips to mostly-static (only glibc dynamically linked), pinned to the lowest supported glibc for broad LTS compatibility; a fully static build remains available via --static. The release also adds task composition improvements: :exec-fn tasks can now depend on other tasks with inherited CLI options, :exec-args can be set directly on tasks, and :cmd trees can reference vars loaded on demand.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.michielborkent.nl/babashka-ffi.html>

## Questions this post answers

### How do I call a C library function like zlibVersion from Babashka?

Babashka 1.13.220 adds a babashka.ffi namespace that lets scripts call C libraries directly. Load a system library with ffi/load-system-library, then define a callable function with ffi/cfn or the defcfn macro specifying argument and return types, for example (ffi/cfn zlib "zlibVersion" [] :string) returns a version string like "1.3.1".

_daily.dev surfaces release notes like this for developers wiring native calls into Clojure scripts._

### Why did Babashka switch to a mostly-static binary on Linux instead of a fully static one?

Babashka 1.13.220 flips the default Linux binary to mostly-static, statically linking all shared C libraries it needs while leaving only glibc dynamically linked, because using babashka.ffi and libraries built on it requires a dynamically linked binary. The binary is built against the lowest practical glibc version for broad LTS compatibility, and a fully static build is still available via the install script's --static flag.

_Developers upgrading install scripts or CI images track binary packaging changes like this on daily.dev._

### What underlying Java API does Babashka's new FFI library use for memory management?

Babashka's ffi namespace builds on java.lang.foreign and requires explicit memory management through arenas, similar to the coffi library for JVM Clojure that inspired parts of its API design. This approach raises exceptions instead of causing segfaults that crash the REPL, and memory can be released deterministically using with-open.

_daily.dev helps developers evaluating FFI approaches in the JVM ecosystem stay on top of library design changes._

## Similar posts on daily.dev

- [Babashka 1.12.215: Revenge of the TUIs](https://daily.dev/posts/babashka-1-12-215-revenge-of-the-tuis-vwhdg85bo) · Lobsters · 1 upvotes · 0 comments

---

Tags: [#sqlite](https://daily.dev/tags/sqlite), [#clojure](https://daily.dev/tags/clojure)

[View this post on daily.dev](https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Babashka 1.13.220 gets FFI","url":"https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn"},"datePublished":"2026-09-05T05:56:02.019Z","dateModified":"2026-09-05T07:59:41.197Z","description":"Babashka 1.13.220 introduces babashka.ffi, a new namespace for calling C libraries directly from Babashka scripts, also usable standalone in JVM Clojure...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/302652d60810fc2f8f0dacb3bd974a2b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/302652d60810fc2f8f0dacb3bd974a2b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"sqlite,clojure","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Babashka 1.13.220 gets FFI"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/babashka-1-13-220-gets-ffi-kswe0ruqn#faq","mainEntity":[{"@type":"Question","name":"How do I call a C library function like zlibVersion from Babashka?","acceptedAnswer":{"@type":"Answer","text":"Babashka 1.13.220 adds a babashka.ffi namespace that lets scripts call C libraries directly. Load a system library with ffi/load-system-library, then define a callable function with ffi/cfn or the defcfn macro specifying argument and return types, for example (ffi/cfn zlib \"zlibVersion\" [] :string) returns a version string like \"1.3.1\". daily.dev surfaces release notes like this for developers wiring native calls into Clojure scripts."}},{"@type":"Question","name":"Why did Babashka switch to a mostly-static binary on Linux instead of a fully static one?","acceptedAnswer":{"@type":"Answer","text":"Babashka 1.13.220 flips the default Linux binary to mostly-static, statically linking all shared C libraries it needs while leaving only glibc dynamically linked, because using babashka.ffi and libraries built on it requires a dynamically linked binary. The binary is built against the lowest practical glibc version for broad LTS compatibility, and a fully static build is still available via the install script's --static flag. Developers upgrading install scripts or CI images track binary packaging changes like this on daily.dev."}},{"@type":"Question","name":"What underlying Java API does Babashka's new FFI library use for memory management?","acceptedAnswer":{"@type":"Answer","text":"Babashka's ffi namespace builds on java.lang.foreign and requires explicit memory management through arenas, similar to the coffi library for JVM Clojure that inspired parts of its API design. This approach raises exceptions instead of causing segfaults that crash the REPL, and memory can be released deterministically using with-open. daily.dev helps developers evaluating FFI approaches in the JVM ecosystem stay on top of library design changes."}}]}
```

