A monadic multi-stage metalanguage

  • Authors:
  • Eugenio Moggi;Sonia Fagorzi

  • Affiliations:
  • DISI, Univ. of Genova, Genova, Italy;DISI, Univ. of Genova, Genova, Italy

  • Venue:
  • FOSSACS'03/ETAPS'03 Proceedings of the 6th International conference on Foundations of Software Science and Computation Structures and joint European conference on Theory and practice of software
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

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 multilingual extensions, where a variety of programming languages (aka monads) co-exist. 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.