Continuation-Passing-Style as an Intermediate Representation for Compiling Scheme
Kris De Volder · 1994
This paper describes the implementation of a small experimental Scheme compiler, using Continuation Passing Style (CPS) as an intermediate representation for the source code. CPS is a form of code that makes control flow and control information explicit. This, in combination with a solid theoretical basis (lambda-calculus) makes it an excellent medium for representing intermediate code. 0 Introduction: The main goal of the project was to study the techniques used in transforming a high-level Scheme program into a low-level program, expressed in a typical, assembler like, register oriented language. We did not aim to produce a viable compiler. Our main interest was to explore the possibilities and usefulness of the CPS approach. Using CPS in compilation is a novel approach to compiler writing, first suggested by Steele [16,17]. It has been successfully applied to write compilers for Scheme in other projects [9,16,18]. We have depended very strongly upon this work, especially upon...