Evaluation strategy

Evaluation (English evaluation as description, analysis and evaluation ) refers to the process of (possibly in a given context of variable bindings ) assigns a value to an expression in computer science.

Programming languages ​​are distinguishable according to their evaluation strategy:

  • In strict evaluation or lazy evaluation ( engl. eager or strict evaluation) are evaluated immediately expressions. For example, when calculating a function only the argument expressions are evaluated with strict evaluation before the function body is evaluated.
  • In contrast stands the needs evaluation or lazy evaluation (English lazy evaluation ), are evaluated in expressions only if their value is needed in a calculation. Thus, for example, infinite data structures can be (eg the list of all natural numbers, the list of all prime numbers, etc. ) and define specific algorithms are simplified. These data structures are called streams (English streams).

Some calculations can be done with strict evaluation, others run more efficiently with demand evaluation.

In the evaluation of functions with a plurality of arguments is a further degree of freedom is in the order of the arguments to be evaluated. In theoretical computer science ( lambda calculus ) is formally shown that the order of evaluation does not matter as far as the calculated value of an expression, so it can be evaluated as; see also currying or Nice Finkeln.

The application of the function (or function definition) to its arguments are also referred to as an application.

Closely related to the concept of evaluation is the notion of semantics, which is a figure that a program (usually a text or program source code) assigns its computable function. This is consistent with the colloquial interpretation of the concept of semantics as meaning assignment well.

  • Compiler
  • Programming language element
90954
de