Mechanised Semantics of Multi-stage Programming
Ka Wing Li, Maite Kramarz, Ningning Xie, Jeremy Yallop
Abstract
Multi-stage programming (MSP) languages such as MetaML have subtle semantics, in which familiar properties often fail to hold and hazardous interactions with other language features such as state or polymorphism abound. The ongoing incorporation of MSP features into general purpose languages makes the need to establish confidence in their design increasingly pressing.
Taking inspiration from existing MSP systems, we present a Rocq mechanisation of a core calculus for compile-time and run-time MSP with effects, 𝜆 $ run , formally establishing key properties such as type and elaboration soundness and phase distinction. We hope that our mechanised semantics will be a useful basis for formal study of other designs, easing the extension of existing languages with support for MSP.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 13c90266-5b76-442a-ae61-2fb3b5986c31Builds on4
- Mœbius: metaprogramming using contextual types: the stage where system f can pattern match on itselfJunyoung Jang, Samuel Gélineau, Stefan Monnier, Brigitte PientkaPOPL 2022 · 28 citations
- Staging with class: a specification for typed template HaskellNingning Xie, Matthew Pickering, Andres Löh, Nicolas Wu et al.POPL 2022 · 17 citations
- Handling Scope Checks: A Comparative Framework for Dynamic Scope Extrusion ChecksMichael Lee, Ningning Xie, Oleg Kiselyov, Jeremy YallopPOPL 2026 · 3 citations
- Progressful Interpreters for Efficient WebAssembly MechanisationXiaojia Rao, Stefan Radziuk, Conrad Watt, Philippa GardnerPOPL 2025 · 3 citations
Related papers
- Refined² Environment ClassifiersYuito Murase, Atsushi IgarashiOOPSLA 2026
- When Do Staging Annotations Preserve Semantics? Mechanizing Typed Semantics-Preserving Multi-stage Programming with Let-InsertionJun Tan, Guannan WeiOOPSLA 2026
- Backwards-Compatible Row-Based Exceptions in MLSimcha van Collem, Paulo Emílio de Vilhena, Robbert KrebbersPLDI 2026
- Contextual MetaML: Syntax and Full AbstractionHaoxuan Yin, Andrzej S. Murawski, C.-H. Luke OngLICS 2026 · 1 citation
- Zooid: a DSL for certified multiparty computation: from mechanised metatheory to certified multiparty processesDavid Castro-Perez, Francisco Ferreira, Lorenzo Gheri, Nobuko YoshidaPLDI 2021 · 25 citations
