Explanation
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.
Non-strictness has several disadvantages which have prevented widespread adoption:
- Because of the uncertainty regarding if and when expressions will be evaluated, non-strict languages generally must be purely functional to be useful.
- All hardware architectures in common use are optimized for strict languages, so the best compilers for non-strict languages produce slower code than the best compilers for strict languages, with the notable exception of the Glasgow Haskell Compiler which outperforms many strict language compilers.
- Space complexity of non-strict programs is difficult to understand and predict.
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. The terms "eager programming language" and "lazy programming language" are often used as synonyms for "strict programming language" and "non-strict programming language" respectively.
In many strict languages, some advantages of non-strict functions can be obtained through the use of macros or thunks.
Read more about this topic: Strict Programming Language
Famous quotes containing the word explanation:
“Are cans constitutionally iffy? Whenever, that is, we say that we can do something, or could do something, or could have done something, is there an if in the offingsuppressed, it may be, but due nevertheless to appear when we set out our sentence in full or when we give an explanation of its meaning?”
—J.L. (John Langshaw)
“To develop an empiricist account of science is to depict it as involving a search for truth only about the empirical world, about what is actual and observable.... It must involve throughout a resolute rejection of the demand for an explanation of the regularities in the observable course of nature, by means of truths concerning a reality beyond what is actual and observable, as a demand which plays no role in the scientific enterprise.”
—Bas Van Fraassen (b. 1941)
“My companion assumes to know my mood and habit of thought, and we go on from explanation to explanation, until all is said that words can, and we leave matters just as they were at first, because of that vicious assumption.”
—Ralph Waldo Emerson (18031882)