An undergraduate compilers course poses significant challenges to students, in both the conceptual richness of the major components and in the programming effort necessary to implement them. In this paper, I argue that a related architecture, the interpreter, serves as an effective conceptual framework in which to teach some of the later stages of the compiler pipeline. This framework can serve both to unify some of the major concepts that are taught in a typical undergraduate course and to structure the implementation of a semester-long compiler project.
A brief account of the concept of partial computation is given in the context of the Pascal language. The manual conversion of programs into generating extensions is explained using examples of gradually increasing complexity. This culminates in a readily applicable but too-little known technique of converting interpreters into compilers without dealing directly with machine language. Students taking courses in language processing should be taught this technique and perhaps also the general principles underlying it. A simple example of the application of the technique is presented.