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.

Full Text
Published version (Free)

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