IT lexicon › Programming › Partial evaluation

Partial evaluation

Programming På svenska → Updated: 2026-11-05

Running a program as far as possible with only some of its inputs known, and keeping what's left as a new, specialized program.

Yoshihiko Futamura laid out the three projections that made the idea famous in 1971. Specialize an interpreter on a given program and you effectively get that program compiled. Specialize the specializer on the interpreter and you get a compiler. Go one level further and you get a compiler generator. Neil Jones, Carsten Gomard and Peter Sestoft turned this into a working discipline; their 1993 book is still the standard reference.

For decades it stayed mostly academic, because specializers that can handle real interpreters are hard to build. GraalVM's Truffle flipped that around: you write an ordinary AST interpreter for your language, and the JIT performs the first projection once the code gets hot. That is how Ruby, Python and JavaScript got fast implementations without anyone writing a compiler for them.

← Back to the lexicon