Partial Evaluation[Neil D. Jones, Carsten K. Gomard, and Peter Sestoft, Partial Evaluation and Automatic Program Generation, Prentice-Hall, 1993; ACM Computing Surveys, vol. 28, no. 3 (Sept. 1996), pp. 480-503.]
Partial evaluation specializes a function with respect to arguments that have known values. Given a program P(x, y) where the values of variables x are constant, a specializing function mix transforms P(x, y) → Px(y) such that P(x, y) = Px(y) for all inputs y. Px(y) may be shorter and faster than P(x, y) . We call x static data and y dynamic data.
Partial evaluation involves:
A good rule of thumb is that an interpreted program takes ten times as long to execute as the equivalent compiled program. Partial evaluation removes interpretation by increasing the binding between a program and its execution environment.