## A Monadic Multi-stage Metalanguage (2003)

### Cached

### Download Links

- [www.disi.unige.it]
- [www.cs.nott.ac.uk]
- [www.macs.hw.ac.uk]
- [www.disi.unige.it]
- DBLP

### Other Repositories/Bibliography

Citations: | 15 - 7 self |

### BibTeX

@MISC{Moggi03amonadic,

author = {E. Moggi and S. Fagorzi},

title = {A Monadic Multi-stage Metalanguage},

year = {2003}

}

### Years of Citing Articles

### OpenURL

### Abstract

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 enough to serve as a reference semantics. For instance, the separation of computational types from code types, makes clear 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 (semantics preserving) simplification rules, and computation steps executed in a deterministic order (because they may have side-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.