Babashka 1.12.215 introduces JLine3 integration, enabling full terminal user interfaces and significantly improving the REPL experience with multi-line editing, completions, and eldoc support.
Babashka 1.12.215 represents a significant milestone in the evolution of this fast-starting Clojure scripting runtime. For those unfamiliar, Babashka uses SCI (Small Clojure Interpreter) to interpret Clojure code and compiles to a native binary via GraalVM, delivering Clojure's expressive power with near-instant startup times. This makes it ideal for shell scripting, build tooling, and CLI applications where JVM startup overhead would be prohibitive.
The headline feature of this release is undoubtedly the integration of JLine3, a Java library for building interactive terminal applications. This addition transforms Babashka from a simple scripting tool into a capable platform for building full terminal user interfaces (TUIs). With JLine3 bundled, developers gain access to terminals, line readers with history and tab completion, styled output, keyboard bindings, and the ability to create custom completers, parsers, and widgets—all from Babashka scripts.
Consider the implications: you can now write interactive CLI tools in Clojure that start instantly as native binaries. The example provided demonstrates a simple interactive prompt that reads lines from the user until EOF (Ctrl+D), complete with proper terminal handling and graceful shutdown. This capability opens up entirely new use cases for Babashka, from interactive configuration tools to REPL-like applications that don't require the full JVM.
Complementing the JLine3 integration is a completely overhauled REPL experience. The console REPL now features multi-line editing that detects incomplete forms and continues reading on the next line with a #_=> continuation prompt. Tab completion is Clojure-aware, powered by SCI, and includes keywords in various formats. Ghost text appears as you type, showing the common completion prefix after the cursor. Eldoc provides automatic argument help when your cursor is inside a function call, and doc-at-point functionality is available with Ctrl+X Ctrl+D. Persistent history across sessions and improved Ctrl+C handling round out the enhancements.
These REPL improvements draw inspiration from established tools like rebel-readline, Leiningen's REPL, and Node.js's REPL, bringing a polished interactive experience to Babashka users. The days of needing rlwrap for a comfortable console REPL are over.
Another significant enhancement is the addition of deftype support for map interfaces. Previously, Babashka's deftype couldn't implement JVM interfaces like IPersistentMap, ILookup, or Associative, which meant libraries that define custom map-like types couldn't work in Babashka. This limitation has been addressed: your deftype must declare IPersistentMap to signal that you want a full map type, while other map-related interfaces are accepted freely since the underlying class already implements them.
This change unlocks several important libraries. core.cache now works unmodified, meaning all cache types (BasicCache, FIFOCache, LRUCache, TTLCache, LUCache) are available. The linked library for insertion-ordered maps and sets also becomes compatible. More significantly, this improvement enables Riddley compatibility, which in turn makes Cloverage (a code coverage library for Clojure) work with Babashka. The Riddley integration required several changes to align SCI's behavior with Clojure: deftype now macroexpands to deftype*, case to case*, and macroexpand-1 accepts an optional env map as the second argument.
The release also brings compatibility with charm.clj, a new Clojure library for building terminal user interfaces using the Elm architecture (Model-Update-View). charm.clj provides components like spinners, text inputs, lists, paginators, and progress bars, with support for ANSI/256/true color styling and keyboard/mouse input handling. The complete counter example demonstrates how easily rich TUI applications can be built that start instantly as native binaries.
Under the hood, SCI received numerous improvements. Functional interface adaptation now allows writing code like (let [^Predicate p even?] (.test p 42)) with automatic adaptation of the Clojure function to the functional interface. Type tag inference from let binding values to binding names reduces the need for explicit type hints in interop-heavy code. Several bug fixes address issues with read operations, letfn with duplicate function names, ns-map not reflecting shadowed vars, NPE in resolve, and method routing on class objects.
Other notable improvements include support for multiple catch clauses with ^:sci/error, fixes for satisfies? on protocols with proxy, and reify support with java.time.temporal.TemporalQuery. The nREPL server now uses non-daemon threads to keep the process alive without requiring @(promise). New built-in sources include clojure.test.junit, and cp437 (IBM437) charset support has been added to the native binary via selective GraalVM charset feature, avoiding a significant binary size increase.
Looking ahead, the Babashka community is already planning Babashka conf 2026 in Amsterdam, following the successful 2023 event in Berlin. The Call for Proposals is open until the end of February, and the organizers are seeking sponsors to cover event costs.
This release represents more than just incremental improvements—it fundamentally expands what's possible with Babashka. The combination of JLine3 support, enhanced REPL capabilities, and improved library compatibility transforms Babashka from a niche scripting tool into a versatile platform for building interactive CLI applications and tools. For Clojure developers who have been frustrated by JVM startup times or who want to leverage Clojure's expressiveness for system administration and tooling, this release removes significant barriers.
The timing is particularly relevant as the demand for rich terminal applications continues to grow. With tools like charm.clj providing a sophisticated framework for building TUIs, and Babashka providing instant startup and native compilation, developers now have a compelling alternative to traditional shell scripting or heavier JVM-based tools. The ability to write interactive, stateful applications in Clojure that start in milliseconds opens up possibilities for everything from interactive configuration wizards to sophisticated monitoring tools.
For existing Babashka users, this release delivers substantial quality-of-life improvements that make daily scripting more pleasant and productive. For those who haven't yet explored Babashka, the 1.12.215 release presents an excellent opportunity to discover what many consider to be the future of Clojure scripting and tooling.
Comments
Please log in or register to join the discussion