Standard ML as a Meta-Programming Language

Abst ract Meta-programming languages, or program generators, are languages whose programs produce programs in other languages. We show how Standard ML makes an excellent meta-programming language, by adding appropriate program-valued | by which we mean string-valued | operations for each domain. We do so by giving four examples of meta-programming languages: a top-down parser generator; a \geometric region server" language modelled on one developed at Yale; a version of the \Message Speciication Language," developed at Oregon Graduate Institute; and a pretty-printing speciication language. Embedding meta-programming languages in ML in this way is easy to do, and the result is a language that, unlike most meta-programming languages, is higher-order.