Loading AI tools
Programming language using strict evaluation From Wikipedia, the free encyclopedia
A strict programming language is a programming language that only allows strict functions (functions whose parameters must be evaluated completely before they may be called) to be defined by the user. A non-strict programming language allows the user to define non-strict functions, and hence may allow lazy evaluation. In most non-strict languages, the non-strictness extends to data constructors.
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
A strict programming language is a programming language which employs a strict programming paradigm, allowing only strict functions (functions whose parameters must be evaluated completely before they may be called) to be defined by the user. A non-strict programming language allows the user to define non-strict functions, and hence may allow lazy evaluation.[1]
Non-strictness has several disadvantages which have prevented widespread adoption:[citation needed]
Strict programming languages are often associated with eager evaluation, and non-strict languages with lazy evaluation, but other evaluation strategies are possible in each case.[citation needed] The terms "eager programming language" and "lazy programming language" are often used as synonyms for "strict programming language" and "non-strict programming language" respectively.[citation needed]
Nearly all programming languages in common use today are strict.[citation needed] Examples include C#, Java, Perl (all versions, i.e. through version 5 and version 7), Python,[2] Ruby, Common Lisp, and ML. Some strict programming languages include features that mimic laziness.[clarification needed] Raku (formerly known as Perl 6) has lazy lists,[3] Python has generator functions,[4] and Julia provides a macro system to build non-strict functions,[5] as does Scheme.
Examples for non-strict languages are Haskell, R, Miranda, and Clean.[6]
In most non-strict languages, the non-strictness extends to data constructors. This allows conceptually infinite data structures (such as the list of all prime numbers) to be manipulated in the same way as ordinary finite data structures. It also allows for the use of very large but finite data structures such as the complete game tree of chess.
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.