Abstract

The multi-stage programming paradigm supports runtime code generation and execution. Though powerful, its potential is impeded by the lack of static analysis support. Van Horn and Might proposed a general-purpose approach to systematically develop static analyses by transforming an environmental abstract machine, which evolves a control string, an environment and a continuation as a program evaluates. To the best of our knowledge, no such semantics exists for a multi-stage language like MetaML.We develop and prove correct an environmental abstract machine semantics for MetaML by gradually refining the reference substitutional natural semantics. Highlights of our approach include (1) progressively refining a single-stage language ISWIM to a CEK-like machine and managing to apply transformations of the same nature to MetaML, (2) leveraging explicit substitutions to bridge the gap between substitutional and environmental semantics, and (3) devising environment chains to model the complexities of variable bindings in multi-stage environmental semantics.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.