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

Targets Overview

The Cambrian transpiler is a domain × language matrix. A domain fixes the execution semantics (what a send, address, or balance means). A language is the carrier syntax the emitter writes. Each public CLI flag selects one supported cell of that matrix.

cambrian-transpiler <input.cam|project.yaml> -o <dir> --target evm|lean

The default target is evm. In project.yaml, set target: evm or target: lean. Unknown names are rejected — there is no silent fallback to a default.

Domain × language

DomainMeaningLanguagesCLI targets
EVMSynchronous call / CREATE2 / ETH-balance modelSolidity, Leanevm, lean

Same-domain cores share semantics. A .cam program that is valid for Domain EVM should behave the same under --target evm and --target lean (modulo Lean-only validation such as L5–L14).

On the EVM domain, evm::* intrinsics and E-family rules apply. Lean keeps property blocks as theorems; --target evm expands them into concrete tests and fuzz cases. Multi-entity invariants are accepted on both public targets.

Informal names vs CLI vs output

Informal nameCLI / project.yamlDomainLanguageTypical output
Solidity@ETH / Solidity-EVM--target evm (default)EVMSolidityFlat src/*.sol (pragma solidity ^0.8.24), Foundry tests, foundry.toml
Lean-EVM--target leanEVMLean 4Lake project: Cambrian/Generated/*.lean, *Spec.lean, World.lean, lakefile.toml
# EVM Solidity + Foundry
cambrian-transpiler contracts/counter.cam -o /tmp/out-evm --target evm

# Lean 4 model of the same EVM domain
cambrian-transpiler contracts/counter.cam -o /tmp/out-lean --target lean
cambrian-transpiler contracts/counter.cam -o /tmp/out-lean --target lean --check-lean

--check-lean runs lake build in the output directory after a Lean emit; on other targets it only warns.

Capability matrix

Capabilityevmlean
Models EVM (evm::*, CREATE2, payable, …)yesyes
Desugars property → test / fuzzyesno (keeps theorems)
Multi-entity invariantsyesyes
Primary test oracleforge testlake build

Choosing a target

  • Ship on Ethereum → evm (Foundry / solc via forge).
  • Prove EVM-domain properties → lean (same semantics, theorem statements; main proofs may be sorry).

Active conformance policy for new language features prioritises Solidity@ETH, then Lean. Details live in the language repo’s docs/TESTING_TARGETS.md.

Chapter map

ChapterContents
Solidity-EVMFlat Solidity, Foundry, CambrianFactory, payable, events/errors
Lean-EVMLake layout, World/*Spec, sorry policy, L-rules