My picture

Peregrine Project

The Peregrine Project provides a unified middle-end for code generation from proof assistants. It supports Agda, Lean, and Rocq and can generate code in C, WebAssembly, LLVM, OCaml, CakeML, Rust, Elm, and Lean.

It puts a focus on correct code extraction: The middle end is verified in the Rocq proof assistant, and some of the frontends and backends are. It is based on an intermediate language called lambda box. The middle end includes verified optimization passes, such as inlining, constant lifting, and unboxing.

Frontends

Frontend Based on Verification Repository
Rocq MetaRocq, ConCert verified peregrine-tool
Agda — unverified agda2lambox
Lean — partially verified lean-to-lambdabox

Backends

All backends are part of peregrine-tool.

Backend Based on Verification
C CertiRocq, then CompCert for x86, ARM, RISC-V partially verified
Wasm CertiRocq-wasm verified
LLVM Vellvm verified
OCaml Malfunction verified
CakeML CakeML compiler verified
Rust ConCert partially verified
Elm ConCert partially verified
Lean, F#, Koka (experimental) — unverified

Sources


Team Members:

Contributors:

Supported by: INRIA, Aarhus University, IOG, Ethereum, AIforMath.

Website based on this basic page template.
Last updated: November 23, 2026.