# 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. ## Install Save as a script file and run: # Babashka — Fast Native Clojure Scripting for the Command Line ## Quick Use ```bash # Install via Homebrew brew install borkdude/brew/babashka # Or via the official installer bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install) # Run a script bb -e '(println "Hello from Babashka!")' bb my-script.clj ``` ## 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 - https://github.com/babashka/babashka - https://babashka.org --- Source: https://tokrepo.com/en/workflows/asset-88a1c2a2 Author: Script Depot