The bizarre, surreal management mess at NUFC even appears to be metamorphosing into an easy,
lazy evaluation of Newcastle's ability to manage itself in the eyes of a few tunnel-visioned businesspeople I spoke to.
The language also supports recursive functions and datatypes, as well as
lazy evaluation. Unique concepts include monads, and type classes.
The aim of lazy evaluation [Friedman and Wise 1976; Henderson and Morris 1976], which underlies lazy functional languages (e.g., see Plasmeijer and van Eekelen [1993]) and equational programming [Hoffmann and O'Donnell 1982b], is to combine an efficient implementation with good termination properties.
the performance of eager implementations" and that "interpreters for strict languages (Caml Light, Epic) do seem on the whole to be faster than interpreters for non-strict languages (NHC, Gofer, RUFLI, Miranda)." A bottleneck for the performance of lazy evaluation, compared to eager evaluation, is that it requires a considerable amount of bookkeeping.
We investigate how an eager implementation can be adapted to do some lazy evaluation. We propose the notion of a laziness annotation, which assigns to each argument of a function symbol either the label "eager" or the label "lazy." Only redexes that are not the subterm of a lazy argument (the so-called "active" redexes) are reduced whenever possible, according to the innermost rewriting strategy.
A standard application of lazy evaluation, where compared to eager evaluation it improves both termination behavior and performance, is the if-then-else construct:
In order to solve this inefficiency, lazy evaluation is usually performed by graph rewriting [Staples 1980] instead of term rewriting.
Two implementations are possible: a full evaluation scheme computes the entire set of answers at once, while a lazy evaluation scheme computes only the result, and nodes from inner operands of the query syntax tree are obtained only if they are necessary to compute the final result.
Experimental results (as demonstrated later) show that lazy evaluation is normally better.
For lazy evaluation, instead, we keep a pointer to a node in the disk, and ask it to do the following (3) given a node, retrieve all of its top-level descendants of the same type and (4) given a node, retrieve all of its children.
Observe that this index is not well suited for lazy evaluation, since it cannot efficiently implement (3).