Eager evaluation

Eager evaluation

Eager evaluation or strict evaluation is the evaluation strategy in most traditional programming languages.

In eager evaluation an expression is evaluated as soon as it gets bound to a variable. This is generally more efficient as a low-level strategy in simple programming languages, as it removes the need to build and manage intermediate data structures representing unevaluated expressions.

The main advantage of eager evaluation is in memory and speed. For example, if the following Basic code was used:x = 5 + 3 * (1 + 5 ^ 2)PRINT xPRINT x + 2then not only would eager evaluation save space (as the original expression would be stored as 83, rather than the expression itself), but also the expression would only have to be evaluated once, as opposed to being worked out once for the line "PRINT x" and again for the line "PRINT x + 2". Note that for many lazily-evaluated programming languages this is not actually the case, due to the effects of memoization.

ee also

*Graph reduction
*Lazy evaluation
*Evaluation strategy


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Evaluation strategy — Evaluation strategies Strict evaluation Applicative order Call by value Call by reference Call by sharing Call by copy restore Non strict evaluation Normal order Call by name Call by need/Lazy evaluation …   Wikipedia

  • Evaluation (disambiguation) — Evaluation is the process of characterizing and appraising something of interest or of determining the value of an expression (mathematics). Computer science * determining the value of an expression (programming) * Eager evaluation or strict… …   Wikipedia

  • Eager Haskell — is an implementation of the Haskell programming language that uses eager evaluation. Sources and External Links * [http://csg.csail.mit.edu/pubs/haskell.html Eager Haskell page at MIT] …   Wikipedia

  • Eager learning — (engl., „Eifriges Lernen“) ist eine Klasse von maschinellen Lernverfahren. Im Gegensatz zum lazy learning findet dabei die Modellbildung offline einmalig auf Basis der Trainingsdaten statt, und nicht online zur Zeit der Anfrage. Der Vorteil ist,… …   Deutsch Wikipedia

  • Lazy evaluation — In computer programming, lazy evaluation (or delayed evaluation) is the technique of delaying a computation until such time as the result of the computation is known to be needed.The actions of lazy evaluation include: performance increases due… …   Wikipedia

  • lazy evaluation — noun Any of a variety of computing techniques that delays the computation of expressions until (and unless) the results are needed. Ant: strict evaluation, eager evaluation …   Wiktionary

  • Short-circuit evaluation — Evaluation strategies Strict evaluation Applicative order Call by value Call by reference Call by sharing Call by copy restore Non strict evaluation Normal order Call by name Call by need/Lazy evaluation Call by …   Wikipedia

  • Lambda calculus — In mathematical logic and computer science, lambda calculus, also written as λ calculus, is a formal system designed to investigate function definition, function application and recursion. It was introduced by Alonzo Church and Stephen Cole… …   Wikipedia

  • Strict programming language — A strict programming language is one in which only strict functions (functions whose parameters must be evaluated completely before they may be called) may be defined by the user. A non strict programming language allows the user to define non… …   Wikipedia

  • Functional programming — In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast with the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”