How useful is knowledge of lambda calculus?

For all people who know lambda calculus : What good did he buy you for programming? Would you recommend that people find out about this?

+66
math computer-science functional-programming lambda-calculus
Sep 22 '08 at 12:34
source share
11 answers

If you want to program any functional programming language , this is necessary. I mean, how useful is it to know about Turing machines? Well, if you write C, the language paradigm is pretty close to Turing machines - you have a pointer to the instruction and the current instruction, and the machine takes some action in the current state, and then moves forward to the next command.

In a functional language, you simply cannot think so - this is not a language paradigm. You should consider lambda calculus and how terms are evaluated there. It will be much more difficult for you to be effective in a functional language if you do not know lambda calculus.

+24
Sep 22 '08 at 12:55
source share

The advantage of lambda calculus is that it is an extremely simple calculation model equivalent to a Turing machine. But while the Turing machine is more like an assembly language, lambda calculus is more like a high-level language. And if you learn Church encodings that will help you learn a programming technique called style continuation-skipping , which is very useful for implementing backtracking searches and other neat tricks.

The main use of lambda calculus in practice is that it is an excellent laboratory tool for learning new ideas in a programming language . If you have an idea for a new language function, you can add a new function to the lambda calculus , and you get something that is expressive enough for programming , being simple enough to study very carefully . This use is really more for language designers and theorists than for programmers.

Lambda calculus is also just very cool in itself: just like knowing assembly language, it will deepen your understanding of calculations . It is especially interesting to program the universal turing machine in lambda calculus. But this is fundamental mathematics, not practical programming.

+73
Dec 17 '08 at 8:06
source share

Honestly, studying lambda calculus before functional programming made me realize that these two are not related to C in any imperative programming.

Lambda calculus is a functional programming language, an esoteric, hold trick, if you like; by chance it is also the first.

Most functional programming languages ​​do not require you to learn lambda calculus at all, no matter what it means, lambda calculus is insanely minimal, you can "learn" its axioms in less than an hour. To know the results from it, like the fixed point theorem, the Church-Rosser theorem, etc. It’s simply not related to functional programming.

In addition, lambda abstractions are often considered "functions", I do not agree with this, these are algorithms and not functions, a slight difference, most of the "functional languages" relate more to their functions in the way classical mathematics does it.

However, for example, in order to use Haskell effectively, you need to understand certain type systems, regardless of lambda calculus, a System F type system can be applied to all "functions" and does not require lambda abstractions at all. Usually in mathematics we say f: R ^ 2 → R: f (x) = x ^ 2. We could say: f (x) = x ^ 2 :: R → R → R. Actually, Haskell comes close to these designations.

Lambda calculus is a theoretical formalism, Haskell functions are actually no more “lambda abstractions” than f: f (x) = x ^ 2, which makes lambda abstractions interesting, so it allows us to determine which is usually considered as “constants” as “functions”, not a single functional language does this because of the huge computational overhead. Haskell, and likewise, is a limited form of System F applied to functions used in everyday classical mathematics. Functions in Haskell, of course, are not anonymous formally symbolic abbreviations, contenders, since they are in the lambda calculus. Most functional programming languages ​​are not symbolic rewriting systems based on reduction. Lisps to some extent, but that the paradigm in itself and its "keyword lambda" do not really satisfy the naming of its lambda calculus.

+21
May 18 '10 at 6:16
source share

I believe that the use of lambda calculus in relation to programming in practice is that it is a fairly minimal system that captures the essence of abstraction (or "anonymous functions" or closure, if you want). Other than that, I don’t think it is important at all, unless you need to implement the abstraction yourself (as Tetha mentioned ( 114646 ).

I also completely disagree with Denis Bueno ( 114701 ), who says that it is necessary for functional programming. It is possible to define, use or understand a functional language without any lambda calculus. To understand the evaluation of terms in functional languages ​​(which, in my opinion, is somewhat contrary to the use of a functional language), you will most likely learn better about term rewriting systems.

+15
Sep 22 '08 at 13:35
source share

I agree with those who say that it is theoretically possible to study functional programming without studying the mathematical calculus of lambda, but what is the advantage of not having to study lambda calculus? It is not as if it requires a large investment of time.

Most likely, this will help you better understand functional programming. But even if it’s not, it’s still a cool thing to learn. Y-combinator is a beautiful thing.

+10
Sep 25 '08 at 12:28
source share

If you want to be a technician and write programs in order to do something, you do not need to know lambda calculus, machines with a finite state, push machines, regular expressions, context-free grammar, discrete mathematics, etc.

But if you have curiosity about the deeper mysteries underlying this material, you may begin to wonder how these questions can be answered. The concepts are beautiful and will expand your imagination. I also think that they, by the way, are doing one of the best practitioners.

What caught me was Minsky’s book, Calculation: Finite and Infinite Machines.

+9
Dec 23 '08 at 14:53
source share

One possible way to study lambda calculus is to

http://en.wikipedia.org/wiki/Lambda_Calculus

Or if you want more, here is my blog on calculating lambda and the like.

http://weblogs.manas.com.ar/lziliani/

Like any abstraction of calculations, with the help of lambda calculus you can model the material used in most programming languages, for example, subtyping. For more information, one of the best books with practical use of lambda calculus in this sense

http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=sr_1_1?ie=UTF8& s = books & QID = 1222088714 & cf = 8-1

+4
Sep 22 '08 at 13:06
source share

I found that lambda calculus was useful for understanding how functional programming works at a deeper level. Especially how to implement functional languages.

This made it easier for me to understand advanced concepts such as type strategies and evaluation strategies (e.g. call by name and call by value).

I do not think that you need to know anything about lambda calculus in order to use the basic methods of functional programming. However, understanding lambda calculus makes it easier to study extended programming theory .

+4
Sep 23 2018-11-11T00:
source share

lambda calculus is a computational model, just like a turing machine. Thus, it is useful if you need to implement a specific evaluator for a language based on this model, but in practice you just need a basic idea (for example, the placement point argument is semantically correct in the function body?) And what about It.

+2
Sep 22 '08 at 12:46
source share

I would also like to mention that if you do anything in the field of NLP, lambda calculus is the basis of a huge amount of work in compositional semantics.

+2
Oct 11 '08 at 6:06
source share

Advantages for me are more compact synergetic programming. Material tends to extend horizontally more than vertically. Plus it is very useful for prototyping simple algorithms. I don’t know if I use it in full, but I find it very useful.

0
Sep 22 '08 at 12:45
source share



All Articles