Partial Evaluation - Futamura Projections

Futamura Projections

A particularly interesting example of this, first described in the 1970s by Yoshihiko Futamura, is when prog is an interpreter for a programming language.

If Istatic is source code designed to run inside said interpreter, then partial evaluation of the interpreter with respect to this data/program produces prog*, a version of the interpreter that only runs that source code, is written in the implementation language of the interpreter, does not require the source code to be resupplied, and runs faster than the original combination of the interpreter and the source. In this case prog* is effectively a compiled version of Istatic.

This technique is known as the first Futamura projection, of which there are three:

  1. Specializing an interpreter for given source code, yielding an executable
  2. Specializing the specializer for the interpreter (as applied in #1), yielding a compiler
  3. Specializing the specializer for itself (as applied in #2), yielding a tool that can convert any interpreter to an equivalent compiler

Read more about this topic:  Partial Evaluation

Famous quotes containing the word projections:

    Western man represents himself, on the political or psychological stage, in a spectacular world-theater. Our personality is innately cinematic, light-charged projections flickering on the screen of Western consciousness.
    Camille Paglia (b. 1947)