Metraipolis › archive › dc_46b600b1e8cf
Refined^2 Environment Classifiers — arXiv:2608.07888
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2608.07888
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-19T09:19:35.918Z
- SHA-256 of the archived text
ae0235123555c8e7a399d6e4f491476da3cb297ed55d387558c0159975c18a27- Stable URL of this page
https://metraipolis.com/documento/dc_46b600b1e8cf
How to cite
Refined^2 Environment Classifiers — arXiv:2608.07888 — arXiv (en), https://arxiv.org/abs/2608.07888 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_46b600b1e8cf (Metraipolis archive dc_46b600b1e8cf, sha256 ae0235123555c8e7a399d6e4f491476da3cb297ed55d387558c0159975c18a27)
BibTeX
@misc{dc46b600b1e8cf,
title = {Refined^2 Environment Classifiers — arXiv:2608.07888},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2608.07888},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_46b600b1e8cf; sha256 ae0235123555c8e7a399d6e4f491476da3cb297ed55d387558c0159975c18a27},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2608.07888. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
MetaML-style multi-stage programming (MSP) supports quasi-quotation-based code generation, runtime execution of generated code, and cross-stage persistence (CSP). However, its interaction with computational effects is subtle: mutable state can cause scope extrusion, where generated code escapes the scope of variables on which it depends. This paper presents a type system for MetaML-style MSP with mutable state that statically rules out harmful scope extrusion while supporting multi-level code generation, runtime execution, and a variant of CSP. Our system builds on refined environment classifiers (RECs), a discipline that annotates code types with the variable scopes on which generated code depends. To scale RECs to the MetaML-style setting, we refine classifiers so that they track not only variable scopes, but also the scopes of classifiers themselves. Further, we integrated polymorphism over classifiers, enabling more general and reusable code generation patterns in a multi-level setting. For the resulting system, we define an operational semantics via a definitional interpreter and prove type soundness and safety of offline code generation, showing that generated code can be extracted as standalone well-typed programs. We provide working implementations and mechanized proofs in Rocq. Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-08-11 in cs.PL). Categorie arXiv: Programming Languages (cs.PL). Pagina del lavoro: https://arxiv.org/abs/2608.07888 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-19T09:15:58.316Z dalla pagina https://arxiv.org/catchup/cs.PL/2026-08-11?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).