Live data from Hacker News

λ Calculus (2013) [pdf]

cs.rpi.edu

41–50 of 73 posts

Re: λ Calculus (2013) [pdf]

#41
Anyone knows if lambda calculus can be done with the standard function notation, or with something closer to that? I understand that lambda calculus works with expressions and symbols, while standard function notation works with functions and values, still using the same notation seems natural to me, x -> e for lambda, and e(x) for application. I haven't worked it out, but I wonder what will I get if I do it?

Re: λ Calculus (2013) [pdf]

#42
post #28

In university, I had fun actually applying lambda calculus. Here’s a very silly python script. # a factorial function written entirely with just single-argumented lambdas # and calls fac = ((lambda p: p(p)(lambda q: lambda n: ((n(lambda e: lambda e: lambda a: a)(lambda i: lambda l: i))(lambda d: lambda c: c) (lambda m: (lambda m: lambda z: m(n(z)))(q(m)))((lambda c: lambda x: n(lambda g: lambda h: h(g(c)))(lambda u:…

You might enjoy this:

https://flownet.com/ron/lambda-calculus.html

Re: λ Calculus (2013) [pdf]

#43
post #39

What is the motivation for lambda calculus?

It was an attempt to find the simplest possible mathematical system that was universal, i.e. could compute any function. It turns out that the answer is that function application by itself is universal (if functions are first-class entities). This was a surprise at the time, and it still generally surprises people today when they first learn of it.

You might find this interesting:

https://flownet.com/ron/lambda-calculus.html

Re: λ Calculus (2013) [pdf]

#45
post #39

What is the motivation for lambda calculus?

A little bit of historical background.

There was a concerted effort in the late 19th, early 20th century (perhaps earlier too) to mechanise computation i.e., reducing it to a pure symbolic manipulation. There were obvious benefits, a famous one being Enigma Machine that was used to (successfully I think) break the German code during WW-2.

On the philosophical side a parallel and overlapping effort was going on to figure out if mathematics could represent all possible truths, again as symbolic manipulation system. Bertrand Russel's magnum opus Principia Mathematica [1] was one such famous work towards it. Kurt Gödel then made a breakthrough when he proved that such a system is impossible; i.e., a system can either capture all the truths or it can be consistent but not both[2]. Put differently, any mathematical system capable of representing all the truths will necessarily contain contradictions within it.

Now coming to your question.

Lambda calculus emerged in this milieu. Alonzo Church[3] invented one such system to mechanise computation, named ƛ-calculus. Using this system one can mechanically compute any function purely by symbolic manipulation. Later on Turing, Church's student I think, invented a totally different system named Turing Machine with the same purpose. Later on it was proved (by Church and Turing I think, but I'm not 100% sure) that ƛ-Calculus and Turing Machine are equivalent, Church-Turing thesis[4].

All these work, and more, laid the theoretical foundation for the modern computers. If we can today safely assume that computers are provably correct it's because of them.

Phil Wadler has an absolutely delightful talk where he takes us through a whirlwind tour of the history of the mathematical foundation of computers [5], highly recommended.

[1] https://en.wikipedia.org/wiki/Principia_Mathematica

[2]https://en.wikipedia.org/wiki/Gödel%27s_incompleteness_theor...

[3] https://en.wikipedia.org/wiki/Alonzo_Church

[4] https://en.wikipedia.org/wiki/Church–Turing_thesis

[5] https://www.youtube.com/watch?v=IOiZatlZtGU

Re: λ Calculus (2013) [pdf]

#46
post #27

Earlier quoted context omitted.

Emulating recursion, and more generally the whole Church-Turing thesis. The fact that you can represent mechanical computation through, well, computation - the fact that equating those concepts makes sense at all, which was such a huge innovation that today it seems too banal to even notice.

You keep answering with the same words though. My question was _where_ the Y combinator is useful, not _what_ it is designed for, which I am of course aware of.

What do you mean "where"? In Princeton? In the Proceedings of the London Mathematical Society? In the head of anyone who presumes to think about computation?

Re: λ Calculus (2013) [pdf]

#47

My favorite discussion of this topic is from David Beazley: https://www.youtube.com/watch?v=5C6sv7-eTKg He does a wonderful job of taking very dense mathematical notation and explaining it in ways that anyone can understand. He derives the basic concepts of the lambda calculus from the ground up using Python. Super fun to follow along with.

This is another excellent video if you are more of a Javascript developer: https://www.youtube.com/watch?v=OLH3L285EiY

Re: λ Calculus (2013) [pdf]

#48
> The normal order sequencing combinator is: Seq = λx.λy.(λz.y x) where z is chosen so that it does not appear free in y.

> This combinator guarantees that x is evaluated before y, which is important in programs with side-effects

This part didn't make sense to me. I can apply Seq to x = Ω = (λx.x x)(λx.x x) and y = (λa.λb.b) and z = λx.x, resulting in Seq x y z = y x = λb.b, which leaves x unevaluated.

A sequencing operator cannot be defined within the lambda calculus, which has no notion of side-effect; it must be a function defined in a runtime, i.e. in an implementation of lambda calculus. An example is the function seq in Haskell.

Re: λ Calculus (2013) [pdf]

#49
post #41

Anyone knows if lambda calculus can be done with the standard function notation, or with something closer to that? I understand that lambda calculus works with expressions and symbols, while standard function notation works with functions and values, still using the same notation seems natural to me, x -> e for lambda, and e(x) for application. I haven't worked it out, but I wonder what will I get if I do it?

> I understand that lambda calculus works with expressions and symbols, while standard function notation works with functions and values

There's no inherent connection. You're perfectly free to interpret lambda terms as functions on a domain, or function definitions as abstract rewrite rules.

Re: λ Calculus (2013) [pdf]

#50
post #48

> The normal order sequencing combinator is: Seq = λx.λy.(λz.y x) where z is chosen so that it does not appear free in y. > This combinator guarantees that x is evaluated before y, which is important in programs with side-effects This part didn't make sense to me. I can apply Seq to x = Ω = (λx.x x)(λx.x x) and y = (λa.λb.b) and z = λx.x, resulting in Seq x y z = y x = λb.b, which leaves x unevaluated. A sequencing o…

Yes, with lazy evaluation, there is no guarantee that x will be evaluated before y (rather the opposite).
Post reply on HN