Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 17, 2026·3 min de lecture

Babashka — Fast Native Clojure Scripting for the Command Line

A native, fast-starting Clojure interpreter for scripting, built with GraalVM native-image, that starts in milliseconds and provides a rich set of built-in libraries.

Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Babashka Overview
Commande avec revue préalable
npx -y tokrepo@latest install 88a1c2a2-81dd-11f1-9bc6-00163e2b0d79 --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

Introduction

Babashka is a native Clojure interpreter designed for scripting. Unlike standard Clojure which requires JVM startup time, Babashka starts in under 10 milliseconds thanks to GraalVM native compilation. It brings the expressiveness of Clojure to shell scripting, data processing, and automation tasks where JVM startup overhead would be prohibitive.

What Babashka Does

  • Runs Clojure scripts with near-instant startup (under 10ms)
  • Includes a rich standard library with built-in support for JSON, YAML, CSV, HTTP, and SQL
  • Provides a babashka.process namespace for shell command execution
  • Supports running tasks defined in a bb.edn project file (like a Clojure Makefile)
  • Executes multi-file projects with namespace resolution and dependency management

Architecture Overview

Babashka is built on the Small Clojure Interpreter (SCI), which interprets Clojure code without JVM compilation. SCI is compiled to a native binary using GraalVM native-image, bundling the interpreter and all included libraries into a single executable. The result is a self-contained binary that provides most of Clojure's functionality with startup times comparable to Bash or Python.

Self-Hosting & Configuration

  • Install via Homebrew, the official bash installer, or download prebuilt binaries from GitHub releases
  • Available for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows
  • Configure project-level tasks and dependencies in a bb.edn file at the project root
  • Dependencies from Clojars and Maven can be loaded at runtime via the :deps key in bb.edn
  • Use bb.edn tasks as a cross-platform alternative to Makefiles or npm scripts

Key Features

  • Near-instant startup makes it practical for CLI tools and git hooks
  • Built-in libraries for HTTP clients, JSON/YAML/CSV parsing, and SQLite access
  • Compatible with a large subset of Clojure, including most of clojure.core
  • Task runner (bb tasks) for defining project automation in Clojure
  • Extensible via pods — external processes that communicate via bencode over stdin/stdout

Comparison with Similar Tools

  • Clojure (JVM) — full language with long startup; Babashka trades some features for instant start
  • Bash — ubiquitous but limited data structures; Babashka offers Clojure's rich collections
  • Python — similar scripting use case; Babashka starts faster and has immutable-first data
  • Deno — fast TypeScript scripting runtime; Babashka serves the Clojure ecosystem
  • Nushell — structured data shell; Babashka provides a full programming language

FAQ

Q: Is Babashka a full Clojure implementation? A: It supports most of Clojure's standard library but not all. Features requiring JVM interop (like Java class loading) are not available.

Q: Can I use Clojure libraries from Clojars? A: Yes, as long as they don't require JVM-specific features. Many popular libraries work out of the box.

Q: How does it compare to Planck or Joker? A: Planck uses ClojureScript on JavaScriptCore; Joker is a Go-based interpreter. Babashka offers the broadest library support and most active development.

Q: Can I build standalone CLI tools with Babashka? A: Yes. You can distribute scripts as single files or use bb.edn projects with dependencies bundled.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires