This commit is contained in:
Miloslav Ciz 2023-04-22 16:13:38 +02:00
parent 991f917979
commit e5834a1aaf
10 changed files with 65 additions and 30 deletions

View file

@ -1,6 +1,6 @@
# Lambda Calculus
Lambda calculus is an extremely simple and low-level [mathematical](math.md) system based on describing computations with [functions](function.md), and can in fact be used to describe and perform any computation. It is a theoretical basis for [functional programming languages](functional.md). It is a **[model of computation](model_of_computation.md)** similar to e.g. a [Turing machine](turing_machine.md) or [interaction nets](interaction_net.md) -- in fact lambda calculus has exactly the same computational power as a Turing machine, which is also the greatest possible computational power, and so it is an alternative to it. Lambda calculus can also be seen as a simple [programming language](programming_language.md), however it is so extremely simple (there are e.g. no numbers) that its pure form isn't used for practical programming, it is more of a mathematical tool for studying computers theoretically, constructing proofs etc. Nevertheless anything that can be programmed in any classic programming language can in theory be also programmed in lambda calculus.
Lambda calculus is an extremely simple and low-level [mathematical](math.md) system that can describe computations with [functions](function.md), and can in fact be used to describe and perform any computation. Lambda calculus provides a theoretical basis for [functional programming languages](functional.md) and is a **[model of computation](model_of_computation.md)** similar to e.g. a [Turing machine](turing_machine.md) or [interaction nets](interaction_net.md) -- lambda calculus has actually exactly the same computational power as a Turing machine, which is the greatest possible computational power, and so it is an alternative to it. Lambda calculus can also be seen as a simple [programming language](programming_language.md), however it is so extremely simple (there are e.g. no numbers) that its pure form isn't used for practical programming, it is more of a mathematical tool for studying computers theoretically, constructing proofs etc. Nevertheless anything that can be programmed in any classic programming language can in theory be also programmed in lambda calculus.
While Turing machines use memory cells in which computations are performed -- which is similar to how real life computers work -- lambda calculus performs computations only by simplifying an expression made of pure mathematical functions, i.e. there are no [global variables](variable.md) or [side effects](side_effect.md) (the concept of memory is basically present in the expression itself, the lambda expression is both a program and memory at the same time). It has to be stressed that the functions in question are mathematical functions, also called **pure functions**, NOT functions we know from programming (which can do all kinds of nasty stuff). A pure function cannot have any side effects such as changing global state and its result also cannot depend on any global state or randomness, the only thing a pure function can do is return a value, and this value has to always be the same if the arguments to the function are same.