Cakes That Bake Cakes: Dynamic Computation in CakeML
Thomas Sewell, Magnus O. Myreen, Yong Kiam Tan, Ramana Kumar, Alexander Mihajlovic, Oskar Abrahamsson, Scott Owens
Abstract
We have extended the verified CakeML compiler with a new language primitive, Eval, which permits evaluation of new CakeML syntax at runtime. This new implementation supports an ambitious form of compilation at runtime and dynamic execution, where the original and dynamically added code can share (higher-order) values and recursively call each other. This is, to our knowledge, the first verified run-time environment capable of supporting a standard LCF-style theorem prover design.
Modifying the modern CakeML compiler pipeline and proofs to support a dynamic computation semantics was an extensive project. We review the design decisions, proof techniques, and proof engineering lessons from the project, and highlight some unexpected complications.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CompCertELF: verified separate compilation of C programs into ELF object files cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
- Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler cites Formally verified speculation and deoptimization in a JIT compiler
- Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler cites Interaction trees: representing recursive and impure programs in Coq
- Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
- PureCake: A Verified Compiler for a Lazy Functional Language cites Interaction trees: representing recursive and impure programs in Coq
- Formally verified speculation and deoptimization in a JIT compiler cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
Cited by top-tier papers1
Builds on5
- Interaction trees: representing recursive and impure programs in CoqLi-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur et al.POPL 2020 · 133 citations
- CompCertM: CompCert with C-assembly linking and lightweight modular verificationYoungju Song, Minki Cho, Dongjoo Kim, Yonghyun Kim et al.POPL 2020 · 49 citations
- Formally verified speculation and deoptimization in a JIT compilerAurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie et al.POPL 2021 · 38 citations
- Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT CompilerAurèle Barrière, Sandrine Blazy, David PichardiePOPL 2023 · 27 citations
- CompCertELF: verified separate compilation of C programs into ELF object filesYuting Wang, Xiangzhe Xu, Pierre Wilke, Zhong ShaoOOPSLA 2020 · 26 citations
Related papers
- Do you have space for dessert? a verified space cost semantics for CakeML programsAlejandro Gómez-Londoño, Johannes Åman Pohjola, Hira Taqdees Syeda, Magnus O. Myreen et al.OOPSLA 2020 · 12 citations
- Certified Compilers à la CarteOghenevwogaga Ebresafe, Ian Zhao, Ende Jin, Arthur Bright et al.PLDI 2025 · 2 citations
- Pyrosome: Verified Compilation for Modular MetatheoryDustin Jamner, Gabriel Kammer, Ritam Nag, Adam ChlipalaOOPSLA 2025
- End-to-End Verification for Subgraph SolvingStephan Gocht, Ciaran McCreesh, Magnus O. Myreen, Jakob Nordström et al.AAAI 2024 · 9 citations
- Verified Density Compilation for a Probabilistic Programming LanguageJoseph Tassarotti, Jean-Baptiste TristanPLDI 2023 · 6 citations
