Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.cljc files 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 compilationcljrs compile produces a standalone native binary via Cranelift.

Source file extensions

ExtensionMeaning
.cljrsNative clojurust source. Always evaluated under the :rust platform.
.cljcCross-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.