
A Short and Painless Introduction to the Lambda Calculus [pdf] - mgechev
http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf
======
analog31
I'll give this a whirl. Meanwhile, I've briefly looked into introductory
articles on Lambda Calculus on more than one occasion, and I'm always left
wondering if it would benefit from a more readable notation. Here's an
example:

S1 ≡ (λwyx.y(wyx))(λsz.s(z)) = λyx.y((λsz.s(z))yx) = λyx.y(y(x)) ≡ 2

I realize that LC is of interest to CS folks who probably think in code
fragments that look a lot like this, but for someone like me, the notation
gets pretty impenetrable, pretty quick.

As I understand it, a number of developments in science and math (calculus,
newtonian mechanics, maybe even algebra) remained the domain of philosophers
until someone came up with a teachable notation.

~~~
yodsanklai
> I realize that LC is of interest to CS folks who probably think in code
> fragments that look a lot like this

LC is code. It is a minimalist programming language. The notation is mature
and has been around for decades. I don't think there are shortcuts for this,
you need to spend time to get accustomed to the syntax, which is the easy
part. But you can always use different syntax if you want to. For instance
LISP or ML like, there are even graphical notations but I don't think it'll
make things easier.

In any case, you usually don't need to write complex terms. Terms can be
denoted by symbols and complex things are defined iteratively. For instance,
after you defined church numerals, you can call them 0,1,2,3....

Besides, the meta theory doesn't require to write tons of terms anyway. For
instance, things like proofs of church rosser property, strong normalization
of simply typed lambda calculus and so on.

However, it's true that some students get scared away by the notation. When it
looks too much like maths, they run away. But make them play with Scheme and
it suddenly much easier!

Actually, in my opinion, the beauty of the LC is that it connects maths and
programming. Things like semantics, type checking, compilation,
interpretation, reduction strategy, all can be defined formally on this
minimal yet turing complete language. And conversely, various logics can be
defined using typed lambda calculus (see Curry Howard isomorphism).

~~~
analog31
Thanks. I'm not scared by math, but might just need to write things down
myself so I can space out the formulas. I never learned math just by reading,
so I suppose that I shouldn't expect to do so with LC. Part of this could be
my crappy eyesight.

~~~
yodsanklai
> I never learned math just by reading, so I suppose that I shouldn't expect
> to do so with LC.

Yes, and I think that's the problem nowadays with internet learning. We go
through a lot of resources, picking up things here and there. And we don't
take the necessary time to write things down and solve exercises.

With the lambda calculus, I think you eventually need to write terms and
perform the reductions. A fun thing to do is to play with fixed point
combinators. It's really not difficult, just take a little patience and
discipline.

------
tacticiankerala
An awesome video which changed my perspective towards lambda calculus and
programming in general:

programming with nothing: [https://www.youtube.com/watch?v=VUhlNx_-
wYk](https://www.youtube.com/watch?v=VUhlNx_-wYk)

------
Confusion
I like this[1] introduction by Henk Barendregt (author of the de facto
standard work on lambda calculus)

[1]
[http://www.cs.ru.nl/~herman/onderwijs/provingwithCA/lambda-s...](http://www.cs.ru.nl/~herman/onderwijs/provingwithCA/lambda-
sel.pdf)

------
kavabean
Note there is a typo in the def of the predecessor function

"The following function generates from the pair (n, n − 1) (which is the
argument p in the function) the pair (n + 1, n − 1):"

which should be

"The following function generates from the pair (n, n − 1) (which is the
argument p in the function) the pair (n + 1, n):"

------
tempodox
Nicely done! This document is short enough to not cause mental overload and
yet explains the most important aspects in a comprehensible way.

Too many “tutorials” read like complete gibberish to the people they're
supposed to address, namely _beginners_ (try understanding `camlp4`, e.g.).
This one doesn't make that mistake.

------
kevincennis
I'm sure this is a dumb question, but can someone explain why it's frequently
written as " _the_ lambda calculus"?

I never see " _the_ algebra" or " _the_ trigonometry", although I realize
that's not a perfect analogy.

~~~
repsilat
It's meant more in the sense you might hear "the ring of the integers" or "the
field of complex numbers". The lambda calculus is a calculus (i.e., one of
many.) "Which calculus? The _lambda_ calculus."

You might not hear "the algebra" very often, but you might talk about _an_
algebra, and if the particular algebra you're talking about is clear from
context you might sometimes refer to it as "the algebra".

In this sense I think the word "calculus" tends to mean "formal system".

~~~
kevincennis
Thanks. That makes sense.

------
grogenaut
LIES! if it was painless it wouldn't be in a PDF

~~~
tempodox
Could you possibly elaborate on this rather capricious remark?

~~~
grogenaut
Sure, PDFs are anything but painless. I need a reader to look at them. Many of
my devices don't have one or have some off brand one. Esp since I don't want
to be beholden to the adobe update process.

~~~
tempodox
I see. On most platforms, you should be able to get some PDF reader, open-
source or otherwise. You could even use your browser. And seriously, what doc
format could you look at without a “reader”?

“painless” was obviously meant with reference to the document's contents, not
its representation format.

Whatever your reasons for disliking PDFs are, you can't expect an author to
pander to every possible idiosyncrasy of the audience.

~~~
grogenaut
I prefer un-rendered LaTex or raw unicode hex streams.

Seriously though what's wrong with just a .txt, html, .md, etc file? All of
those read easily. PDF.js is a real hog on lots of machines.

Do you get mad when people send out party invites as attached word documents?
Same deal here.

