Strict programming language

Strict programming language

A strict programming language is one in which only strict functions (functions whose parameters must be evaluated completely before they may be called) may be defined by the user. A non-strict programming language allows the user to define non-strict functions, and hence may allow lazy evaluation.

Examples

Nearly all programming languages in common use today are strict. Examples include C, C++, C#, Java, Perl (up through version 5), Python, Ruby, Common Lisp, Scheme, and ML. The best known non-strict languages are Haskell, Miranda, and Clean.

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[citation needed].
  • 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.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Haskell (programming language) — Haskell Paradigm(s) functional, lazy/non strict, modular Appeared in 1990 Designed by Simon Peyton Jones, Lennart Aug …   Wikipedia

  • C (programming language) — C The C Programming Language[1] (aka K R ) is the seminal book on C …   Wikipedia

  • Pascal (programming language) — Pascal Paradigm(s) imperative, structured Appeared in 1970 Designed by Niklaus Wirth Typing discipline static, strong, safe …   Wikipedia

  • Eiffel (programming language) — Infobox programming language name = Eiffel paradigm = object oriented year = 1986 designer = Bertrand Meyer developer = Bertrand Meyer Eiffel Software latest release version = 4.2 latest release date = Feb 6, 1998 typing = static typing, strong… …   Wikipedia

  • Racket (programming language) — Racket Paradigm(s) Multi paradigm: Functional, Procedural, Modular, Object oriented, Reflective, Meta Appeared in 1994 Developer …   Wikipedia

  • Mesa (programming language) — Mesa Appeared in 1970s and 80s Developer Xerox PARC Typing discipline strongly typed Influenced by ALGOL Influenced Java, Modula 2, Cedar Mesa was an innovat …   Wikipedia

  • Erlang (programming language) — Erlang Paradigm(s) multi paradigm: concurrent, functional Appeared in 1986 Designed by Ericsson …   Wikipedia

  • Mercury (programming language) — For Mercury Autocode, see Autocode. Mercury Paradigm(s) Logic, functional Appeared in 1995 Designed by Zoltán Somogyi …   Wikipedia

  • Curry (programming language) — This article is about the programming language Curry. For the computer science technique, see Currying. Curry Paradigm(s) functional, logic, non strict, modular Designed by Michael Hanus, et al. Typing discipline static, strong, inferred …   Wikipedia

  • Euphoria (programming language) — Euphoria openEuphoria logo Paradigm(s) Imperative, procedural Appeared in 1993 Designed by Jeremy Cowgar, Robert Craig (original), Matt Lewis, Derek Parnell …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”