bb
Native Clojure interpreter for scripting
TLDR
Build Clojure project
SYNOPSIS
bb [options] [file] [args]
DESCRIPTION
bb (Babashka) is a native Clojure interpreter for scripting. It provides fast startup times and can run Clojure scripts without JVM overhead, making it suitable for shell scripting and task automation.
The tool enables using Clojure for tasks typically handled by bash or Python scripts.
PARAMETERS
-e, --eval expr
Evaluate expression-f, --file file
Run file-m, --main ns
Call main function in namespace--repl
Start REPL--nrepl-server
Start nREPL server--classpath cp
Set classpath--uberscript file
Create standalone script
CONFIGURATION
bb.edn
Project configuration file for tasks, dependencies, and classpath settings.
FEATURES
- Fast startup (milliseconds)
- Most of Clojure core
- Common libraries included
- Task runner (bb.edn)
- Pod system for native bindings
- Compatible with Clojure syntax
- Shell out capabilities
TASK RUNNER
Define tasks in bb.edn:
{test {:doc "Run tests"
:task (shell "clojure -M:test")}}}
CAVEATS
Not full Clojure (some features missing). Not as fast as compiled code. Limited Java interop. Some libraries don't work. Pods add complexity.
HISTORY
Babashka was created by Michiel Borkent in 2019 to enable fast Clojure scripting without JVM startup overhead.
