Lambda lifting as an optimization for compiling Scheme to C

Abstract

Abstract. We describe an optimizing Scheme-to-C compiler Hobbit. The innovation implemented in Hobbit is the usage of the technique of lambda-lifting (see [Hughes 84], [Johnsson 85], [Peyton-Jones 87]) combined with standard closures to compile lambda expressions and higher-order functions in the context of an impure functional language like Scheme and the object language like C. Lambda-lifting avoids the need for accessing the variables through an environment. Lambda-lifting is not always applicable to lambda-terms in Scheme. It is applicable only in case the code surrounding the lambda-term satisfies certain criteria, which is checked by Hobbit using global analysis. In all the other cases the compiler reverts to using closures. Lambda-lifting as an optimization for compiling Scheme to

    Similar works

    Full text

    thumbnail-image

    Available Versions