Introduction
clojurust is a Rust-hosted dialect of the Clojure programming language. It reads
and executes .cljrs and .cljc source files, provides an interactive REPL, and
can AOT-compile programs to standalone native binaries.
Goals
- Interpreter — read and execute
.cljrs(native) and.cljc(cross-platform) source files. - Reader conditionals —
.cljcfiles use#?(:rust ... :clj ... :default ...)to branch on platform; the platform key for clojurust is:rust. - Rust interop — Clojure code can call Rust functions through a defined set of conventions and type-marshalling primitives.
- Garbage collector — a tracing GC manages all Clojure values; an optional region-based allocator is available for allocation-heavy code paths.
- AOT compilation —
cljrs compileproduces a standalone native binary via Cranelift.
Source file extensions
| Extension | Meaning |
|---|---|
.cljrs | Native clojurust source. Always evaluated under the :rust platform. |
.cljc | Cross-platform source. Reader conditionals select the active branch; clojurust evaluates :rust branches. |
Quick start
cljrs run hello.cljrs
cljrs repl
cljrs eval '(+ 1 2)'
cljrs compile app.cljrs -o app
cljrs test --src-path test
Detailed documentation for each subcommand is in the CLI chapter.