Partial evaluation is the technique of evaluating as much of a program
as possible at compile time, leaving only data-dependent computations
- Constant folding: &pi · 2 &rarr 6.28
- Operations involving special constants: x · 1 &rarr x
- Simplification of if statements when the test
is constant allows removal of interpretation.
- Method dispatch in OOP when type is known.
(draw x) &rarr (draw-circle x)
- Strong typing: eliminates type testing at runtime if types are known.
- Inline expansion: eliminates function call overhead, allows