Strict programming language
Programming language using strict evaluation
title: "Strict programming language" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["programming-paradigms", "evaluation-strategy"] description: "Programming language using strict evaluation" topic_path: "technology/programming-languages" source: "https://en.wikipedia.org/wiki/Strict_programming_language" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Programming language using strict evaluation ::
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.
Description
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.
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.
- Space complexity of non-strict programs is difficult to understand and predict.
- In many strict languages, some advantages of non-strict functions can be obtained through the use of macros or thunks. 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.
Examples
Nearly all programming languages in common use today are strict. Examples include C#, Java, Perl (all versions, i.e., through versions 5 and 7), Python, Ruby, Common Lisp, and ML. Some strict programming languages include features that mimic laziness. Raku (formerly named Perl 6) has lazy lists, Python has generating functions, and Julia provides a macro system to build non-strict functions, as does Scheme.
Examples for non-strict languages are Haskell, R, Miranda, and Clean.
Extension
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.
Citations
References
- {{Citation | last =Scott | first =Michael Lee | editor-last =McFadden | editor-first =Nate | editor2-last =Witte | editor2-first =Valerie | display-editors =1 | others =Published by Denise Penrose | date =2006 | orig-date =1999 | title =Programming Language Pragmatics | edition = | volume =2 | publisher =Morgan Kaufmann | publication-place =San Francisco | isbn =9780126339512 | oclc =551774322 | url =https://books.google.com/books?id=TLbvODF1uIEC | accessdate =21 November 2014
- {{Citation | editor-last =Cluet | editor-first =Sophie | editor2-last =Hull | editor2-first =Rick | editor3-last =Goos | editor3-first =Gerhard | editor4-last =Hartmanis | editor4-first =Juris | editor5-last =van Leeuwen | editor5-first =Jan | display-editors =2 | date =1998 | orig-date =1997 | title =Database Programming Languages | series =Lecture Notes in Computer Science | volume =1369 | publisher =Springer | publication-place =Berlin; Heidelberg | isbn =9783540648239 | issn =0302-9743 | oclc =873553545 | url =https://books.google.com/books?id=mf070SFg1qQC | accessdate =21 November 2014 | ref=
References
- (2015). "Functional Python Programming". Packt Publishing.
- "Raku Programming/Lazy Lists and Feeds - Wikibooks, open books for an open world".
- (2015). "Functional Python Programming". Packt Publishing.
- Innes, Mike J.. (2021-02-06). "MikeInnes/Lazy.jl".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::