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

Building from Source

These steps assume you already have the cambrian-lang workspace (proprietary; not a public download — see Prerequisites).

Build the transpiler from the workspace root.

Build

cd cambrian-lang
cargo build --release

The binary is:

target/release/cambrian-transpiler

Optionally put it on your PATH:

ln -s "$(pwd)/target/release/cambrian-transpiler" ~/.local/bin/cambrian-transpiler

Invoke it as ./target/release/cambrian-transpiler from the repo, or as cambrian-transpiler once it is on PATH. The examples below assume the binary is on PATH.

CLI usage

cambrian-transpiler <input.cam> [-o <output_dir>] [--target evm|lean]
                    [--dump-ast] [--source-map] [--check-lean]

cambrian-transpiler --project <project.yaml> [--check-lean]
FlagMeaning
-o <dir>Write generated files under <dir>. Default: build/<Entity>-entity/.
--target <name>Backend: evm (default) or lean.
--project <yaml>Load a multi-file project from project.yaml (sources, optional library_paths / imports, target, output dir).
--dump-astPretty-print the parsed program and exit (no codegen).
--source-mapEmit .cam.map JSON alongside generated code (where supported).
--check-leanAfter --target lean, run lake build in the output directory.

Targets at a glance

--targetOutput
evm (default)Flat Solidity under src/, plus Foundry harness when tests are present
leanLean 4 + Lake project

Examples:

# EVM Solidity (default)
cambrian-transpiler contracts/counter.cam -o /tmp/counter-evm --target evm

# Lean 4 project (optionally verify with lake)
cambrian-transpiler contracts/counter.cam -o /tmp/counter-lean --target lean --check-lean

# Multi-file project
cambrian-transpiler --project path/to/project.yaml

# Inspect parse result only
cambrian-transpiler contracts/counter.cam --dump-ast

Workspace tests

From the same repository root:

cargo test --workspace

Next steps

Continue to the Quick Start, or set up Editor Support.