eager evaluation


Also found in: Wikipedia.

eager evaluation

Any evaluation strategy where evaluation of some or all function arguments is started before their value is required. A typical example is call-by-value, where all arguments are passed evaluated. The opposite of eager evaluation is call-by-need where evaluation of an argument is only started when it is required.

The term "speculative evaluation" is very close in meaning to eager evaluation but is applied mostly to parallel architectures whereas eager evaluation is used of both sequential and parallel evaluators.

Eager evaluation does not specify exactly when argument evaluation takes place - it might be done fully speculatively (all redexes in the program reduced in parallel) or may be done by the caller just before the function is entered.

The term "eager evaluation" was invented by Carl Hewitt and Henry Baker <hbaker@netcom.com> and used in their paper ["The Incremental Garbage Collection of Processes", Sigplan Notices, Aug 1977. ftp://ftp.netcom.com/pub/hb/hbaker/Futures.html]. It was named after their "eager beaver" evaluator.

See also conservative evaluation, lenient evaluation, strict evaluation.
References in periodicals archive ?
In order to reduce this kind of overhead, in practice lazy evaluation is often adapted to do a lot of eager evaluation.
In lazy functional languages, strictness analysis and programmer-provided strictness annotations are used to do as much eager evaluation as possible.
A standard application of lazy evaluation, where compared to eager evaluation it improves both termination behavior and performance, is the if-then-else construct:
For instance, in the case k = 0, eager evaluation yields
Laziness annotations can be implemented by irreducible encodings called thunks [Ingerman 1961], which make it possible to forget about laziness, and focus on eager evaluation only.
is applied to a term f(t), in the setting of eager evaluation with a laziness annotation.
We prove that eager evaluation with respect to the transformed TRS simulates lazy rewriting with respect to the original TRS, using a simulation notion from Fokkink and van de Pol [1997].
Recall that eager evaluation of the term nth(succ(0), inf(0)) leads to an infinite reduction.
We have defined transformation rules for left-linear rewrite systems, such that lazy rewriting with respect to the original rewrite system is simulated by eager evaluation with respect to the transformed rewrite system.
These implementations are lazy by nature, but are optimized to perform as much eager evaluation as possible.