Mechanised Semantics of Multi-stage Programming
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.
Authors
- Ningning Xie (ORCID: https://orcid.org/0000-0002-5961-1493)
- Jeremy Yallop (ORCID: https://orcid.org/0009-0002-1650-6340)
- Maite Kramarz (ORCID: https://orcid.org/0009-0006-0623-2293)
- Ka Wing Li
Institutions
- University of Toronto (CA)
- University of Cambridge (GB)
Publication Details
- Journal
- Proceedings of the ACM on Programming Languages
- Published
- 2026-04-10
- DOI
- https://doi.org/10.1145/3798260
- Primary Topic
- Formal Methods in Verification
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Natural Sciences and Engineering Research Council of Canada
- Defense Sciences Office, DARPA
- Air Force Research Laboratory