calcit
Indentation-based ClojureScript dialect in Rust and compiling to JavaScript ES Modules
Calcit: a ClojureScript dialect that compiles to JavaScript
Calcit is a Lisp dialect semantically close to ClojureScript, built in Rust, that compiles to JavaScript ES Modules.
What Calcit is
Calcit is a scripting language that is semantically a dialect of ClojureScript and is built with Rust. It compiles to JavaScript ES Modules so the output runs in browsers and Node projects. The interpreter runs on Rust and is extensible through Rust FFI, and it uses persistent data structures for its core values. Its syntax is indentation based through the Cirru format, which the authors describe as friendly to plain text editing, and it keeps Lisp macros and a functional style. Calcit offers hot code swapping, which helps when iterating on a running program. The language is CLI first, with two main tools: `calcit` is the runtime and JS compiler, and `caps` downloads dependencies declared in a deps.cirru file. You install both with cargo install. The current direction favors CLI-first development that works well with AI agents in terminal workflows, and the project improves CLI editing and validation for CI, docs lookup, module management, and incremental updates. A WASM version can be tried online, and example projects show the language in use. The home page, API docs, and a guidebook give readers places to start, and the project frames itself as a small language rather than a large framework, which keeps the toolchain approachable for new users. The WASM build lets a reader try the language in a browser without installing Rust or Node, which widens who can evaluate it before committing to a local toolchain.
Running and compiling
Calcit runs programs from a runtime snapshot file. The primary source snapshot is calcit.cirru, and the legacy compact.cirru filename remains compatible. You can evaluate snippets directly, such as `calcit eval 'range 100'`, or run a snapshot file with `calcit calcit.cirru`. A watch mode exists but requires an explicit flag. By default Calcit reads init and reload functions from the snapshot config, and you can also name functions on the command line. For JavaScript output, `calcit js` compiles to JS and picks the snapshot by default, writing to a js-out directory unless you set an emit path. The generated JS still expects JavaScript interop in browser or Node projects, and you run it from an entry file that imports the compiled module. The README shows the mapping between a Calcit function name and its generated JS export, with the main exclamation mark in a name becoming a low line character with an x suffix. This path keeps the language practical: you write in a Lisp dialect and ship standard ES Modules that any JS toolchain can load. The project also provides a setup action for GitHub workflows so CI can install calcit and run validation on each change. The mapping to a distinct JS identifier means existing JavaScript tooling can consume the output without special handling, so the compiled module drops into a normal build.
Modules and agent workflow
Dependencies live in deps.cirru, which declares the repositories to download and may name a branch or a tag. Running `caps` resolves the recursive dependency graph and installs it. Immutable revisions are stored under a config directory, while the current project receives links under a dot-calcit modules folder, so different projects can use different revisions without switching a shared checkout. Published SemVer tags are preferred, and branch refs are supported for development with a warning showing the resolved commit. The CLI and agent workflow centers on plain text editing plus CLI validation, often driven by an AI agent in a terminal. Common commands include `calcit docs agents` to read the agent workflow guide, `calcit query search` to locate code by symbol or string, and `calcit edit` for structured edits to definitions, imports, config, and modules. The older Calcit Editor is no longer the recommended path for everyday development. Related examples such as Minimal Calcit and the Respo Calcit Workflow show real usage, and setup-calcit helps new GitHub Actions workflows install the tool. The design keeps the language small while giving agents and humans the same command surface, so automation and manual editing share one mental model. The module cache stores immutable revisions per project, so two checkouts can pin different versions of the same dependency without conflict on a shared machine.
Development and license
Contributing to Calcit means working in Rust and running a clear validation flow. Local checks include `cargo fmt`, `cargo clippy` with warnings as errors, `yarn compile`, `cargo test`, and `yarn check-all`. Internal compiler and WASM validation run through dedicated subcommands. The project depends on a few focused Rust crates: a Cirru parser for the indentation-based syntax, a Cirru EDN reader for the snapshot file, and a ternary tree for the immutable list data structure. Extra tools include an error viewer for the dot-calcit error file and an IR viewer for the program intermediate representation. Dev logs and video records point to community channels. On licensing, the README states MIT, which differs from the repository metadata that lists no SPDX license, a gap worth noting for anyone redistributing the code. The practical read is that Calcit is a small, Rust-built Lisp that targets JavaScript output and values CLI driven workflows, including ones guided by agents, over a heavy editor. Its snapshot file format and module cache keep projects isolated while sharing a single toolchain, which keeps builds reproducible across machines. The MIT statement in the README is the only license note present, so a redistributor should confirm the actual LICENSE file before shipping a derivative work based on the code.
Editorial conclusion
Calcit compiles to JavaScript ES Modules, is built in Rust, and its repository was last updated on 2026-08-24.
Community notes