Evaluation (computer science)

from Wikipedia, the free encyclopedia

Evaluation (Engl. Evaluation as a description, analysis and evaluation) referred to in the computer science the operation of an expression (possibly in a given context of variable bindings) a value associates.

Programming languages can be differentiated according to their evaluation strategy:

  • In the case of a strict evaluation or strict evaluation ( eager or strict evaluation ), expressions are evaluated immediately. For example, when calculating a function, with strict evaluation, the argument expressions are evaluated first before the function body is evaluated.
  • In contrast, the standing requirement evaluation or lazy evaluation (Engl. Lazy evaluation ), are not evaluated in terms if its value is required in a calculation. This allows z. B. define infinitely large data structures (e.g. the list of all natural numbers, the list of all prime numbers, etc.) and certain algorithms are simplified. These data structures are called streams (Engl. Streams ).

Some calculations can be carried out more efficiently with a strict evaluation, others with a needs evaluation.

When evaluating functions with multiple arguments, another degree of freedom is the order in which the arguments are evaluated. In theoretical computer science ( lambda calculus ) it is formally shown that the order of evaluation does not play a role in the calculated value of an expression, if it can be evaluated; see also currying or Schönfinkeln .

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

Closely related to the term evaluation is the term semantics , which is a mapping that assigns a program (mostly a program text or source code) its calculable function. This agrees well with the colloquial interpretation of the term semantics as an assignment of meaning.