Partial evaluation of an applied lambda calculus was done some years ago in the lambda-mix project. When moving to pure lambda calculus, some issues need to be considered, most importantly how we represent programs in pure lambda calculus. We start by presenting a compact representation schema for λ-terms and show how this leads to an exceedingly small and elegant self-interpreter. Partial evaluation is discussed, and it is shown that partial evaluation in the most general sense is uncomputable. There are several ways of restricting partial evaluation. We choose one of these, which requires explicit binding time information. Binding time annotations are discussed, and the representation schema is extended to include annotations. A partial evaluator is then constructed as an extension of the self-interpreter, and self-application is performed to produce possibly the smallest non-trivial compiler generator in the literature. It is shown that binding time analysis can be done by modifying the type-inference based method of lambdamix.
[1]
Fritz Henglein.
Dynamic Typing
,
1992,
ESOP.
[2]
Carsten K. Gomard.
Partial type inference for untyped functional programs
,
1990,
LISP and Functional Programming.
[3]
Anders Bondorf,et al.
A self-applicable partial evaluator for the lambda calculus
,
1990,
Proceedings. 1990 International Conference on Computer Languages.
[4]
Frank Pfenning,et al.
Higher-order abstract syntax
,
1988,
PLDI '88.
[5]
John C. Reynolds,et al.
Three Approaches to Type Structure
,
1985,
TAPSOFT, Vol.1.
[6]
Torben Mogensen Diku.
Eecient Self-interpretation in Lambda Calculus
,
1994
.
[7]
Neil D. Jones,et al.
A partial evaluator for the untyped lambda-calculus
,
1991,
Journal of Functional Programming.