next up previous
Next: A Brief Digression on Up: But Mom, I don't Previous: But Mom, I don't

Motivation and Background

Functional-language compilers often use an intermediate representation (IR) based on the $\lambda$-calculus. These IR's generally come in two flavors:

In general, we have

\begin{displaymath}\lambda\mbox{-calculus} \supseteq \mbox{DS} \supseteq \mbox{CPS} \end{displaymath}

To the right, we have more regular IRs, but programs require more functions (which obscure original program structure). To the left, we have more compact representations that are faithful to the original program.

Closure conversion phases of compilation generally transform programs to a first-order IR (either in DS or CPS). In this first-order IR, tail calls to known functions can be implemented as gotos (as opposed to indirect jumps or calls and returns).

Local CPS: allow a direct-style compiler to increase the number of tail-calls to known functions; locally apply CPS conversion; i.e., only convert the caller and do not requires whole-program analysis.


next up previous
Next: A Brief Digression on Up: But Mom, I don't Previous: But Mom, I don't
Matthew Fluet 2002-02-22