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

Prerequisites

Install only what you need for the targets you plan to use. Building the transpiler from source requires Rust; a prebuilt binary needs no Rust at all. EVM and Lean tooling are optional until you exercise those backends.

Rust (for building from source)

Cambrian is a Rust workspace. Install the toolchain with rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Confirm rustc and cargo are on your PATH:

rustc --version
cargo --version

Keep the toolchain current with rustup update.

Getting the source (cambrian-lang)

The Cambrian transpiler, reference contracts and component library live in the open-source cambrian-lang repository, licensed under the GNU GPL v3.0 only:

git clone https://github.com/Ordocode/cambrian-lang.git

Build from its root (see Building from Source). Sample contracts such as contracts/counter.cam are in that tree. If you only need the CLI, download a prebuilt binary instead.

Foundry (for --target evm)

The EVM backend emits Solidity (^0.8.24) and, when the program includes test / fuzz / invariant blocks, a Foundry project (foundry.toml, setup.sh, and tests under test/).

Install Foundry so forge is available:

curl -L https://foundry.paradigm.xyz | bash
foundryup
forge --version

Lean 4 and Lake (for --target lean)

The Lean backend emits a Lake project (lakefile.toml, pinned lean-toolchain, and generated modules under Cambrian/). Install Lean 4 via elan:

curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
elan --version
lake --version

The generated lean-toolchain file pins the Lean version for that output; Lake will fetch it on first lake build.

Tested versions

ToolVersion pinned or tested
Leanleanprover/lean4:v4.29.1 (generated lean-toolchain; override with lean.lean_toolchain in project.yaml)
solc0.8.24, evm_version = "prague" (generated foundry.toml)
Foundry1.x (CI uses v1.7.1)

What you do not need

Node.js is not required for building the transpiler or for the evm or lean workflows described in this book.

Checklist

ComponentNeeded forCheck
Rust / CargoBuilding from sourcerustc --version
Foundry (forge)Running EVM testsforge --version
elan / LakeBuilding Lean outputlake --version

Next: Building from Source.