E. Moggi and S. Fagorzi

A monadic multi-stage metalanguage

Submitted, 2002


We describe a metalanguage MMML, which makes explicit the order of evaluation (in the spirit of monadic metalanguages) and the staging of computations (as in languages for multi-level binding-time analysis). The main contribution of the paper is an operational semantics which is sufficiently detailed for analyzing subtle aspects of multi-stage programming, but also intuitive to serve as a reference semantics. For instance, the separation of computational types from code types, makes immediate the distinction between a computation for generating code and the generated code, and provides a basis for multi-lingual extensions, where a variety of programming languages (aka monads) coexist. The operational semantics consists of two parts: local (semantic preserving) simplification rules, and computation steps executed in a deterministic order (because they may have side-effects). The two parts can be changed independently: the first by adding datatypes or recursive definitions, the second by adding other computational effects. We focus on the computational aspects, thus we adopt a simple type system, that can detect usual type errors, but not the unresolved link errors. Because of its explicit annotations, MMML is suitable as an intermediate language, but (in comparison to MetaML) it is too verbose as a programming language.


[ bib | .pdf ]

Back


This file has been generated by bibtex2html 1.43