In this section, we illustrate our method by building the front end of a compiler for a small imperative while-language. We proceed in three steps. First, we introduce the language and its denotational semantics by giving a monadic interpreter as a one stage METAML \ program. Second, we stage this interpreter by using a two stage METAML \ program in order to produce a compiler. Third, we illustrate the usefulness of the staging approach, by showing how using MetaML's intensional analysis tools can be used to optimize or further translate the output of a staged program.