CertiRocq
A verified compiler for Gallina, the Rocq Prover specification language, targeting WebAssembly and Clight (C).
At a Glance
CertiRocq core compiler distributed under the MIT license.
Engagement
Available On
Listed Dec 2026
About CertiRocq
CertiRocq is an open-source compiler for Gallina, the specification language of the Rocq Prover. It targets WebAssembly and Clight, a subset of C that can be compiled with any C compiler, including the CompCert verified compiler. The latest listed release is v0.9.1+9.1, built for Rocq 9.1.
What It Is
CertiRocq compiles programs written in Gallina into executable code. Large parts of the compiler have been verified in Rocq, while others are still being verified. It is written in Gallina itself and distributed under the MIT license.
How the Pipeline Works
The compiler takes MetaRocq's erased LambdaBox language and translates it into CertiRocq's λANF intermediate representation. An optimization pipeline with accompanying proofs then runs over that representation. Separate code generators emit Clight and WebAssembly, and glue-code generation supports interfacing with the generated code. A C runtime with FFI helpers supports generated programs.
Plugins and Usage
The CertiRocq plugin for Rocq compiles Gallina to C, and the project wiki documents how to interface with the generated C code. Two plugin variants exist: the main plugin and a vanilla-extraction variant, which is the more conservative option and is the basis for the bootstrapped tools. The repository also includes a bootstrapped CertiRocq plugin and a CertiRocq-compiled variant of MetaRocq's safe type checker. End-to-end examples are provided in the test programs.
Collections
Popular collections
- Let Your Agents Talk to Each Other
Collection by @leftchannel
- See What Your Agent Is Doing remix
Collection by @joemseifi
- Let Your AI Read the Document, Not Just the Words
Collection by @priyashah
- Local-First Databases
Collection by @joemseifi
Add CertiRocq to one of your collections.
Community Discussions
Be the first to start a conversation about CertiRocq
Share your experience with CertiRocq, ask questions, or help others learn from your insights.
Pricing
Open Source
CertiRocq core compiler distributed under the MIT license.
- MIT license
- Compiler for Gallina targeting WebAssembly and Clight
- Rocq plugin
- Self-hosted; installation instructions in INSTALL.md
Capabilities
Key Features
- Compiles Gallina to Clight (C)
- Compiles Gallina to WebAssembly
- Partially verified compiler pipeline with Rocq proofs
- λANF intermediate representation with optimization pipeline
- Rocq plugin for compiling Gallina to C
- Vanilla-extraction plugin variant
- Bootstrapped CertiRocq plugin
- C runtime and FFI helpers
- Glue-code generation
