
Compiling to lambda-calculus: Turtles all the way down  - budu
http://matt.might.net/articles/compiling-up-to-lambda-calculus/
======
sb
While this is a nice article on compiling to lambda calculus, the uninitiated
might find Barendregt's "Introduction to Lambda Calculus"
(ftp://ftp.cs.ru.nl/pub/CompMath.Found/lambda.pdf) an invaluable resource.
(IMHO, it's the best work for groking lambda calculus, at least it was for me
and my learning prefernece/style)

------
shasta
"The other direction requires more thought: how do you coax such a simple
language into providing the features we expect of a modern programming
language, such as numbers, Booleans, conditionals, lists and recursion? "

No, the other direction requires simulating a Turing machine with lambda
calculus.

~~~
mattmight
Good point.

But, those are exactly the language features that make it easy to implement a
Turing machine.

~~~
jacquesm
Hey Matt,

Just a quick little note to thank you for your series of posts, not just this
one. I've been trying to get my head wrapped around the lambda calculus and
your posts have been by far the most enlightening ones on the subject.

Thank you very much!

~~~
mattmight
Thanks for reading! I'll keep the posts coming.

------
joshrule
I'm always a bit awed when recognizable functions like 'if' and 'let' start
emerging from a mess of lambdas and Xs. It amazing how simple items and simple
rules can combine to create fantastically intricate systems (i.e. the entire
space of computable functions). Thanks for sharing, Matt.

------
fexl
I've been working on a combinatoric approach with Fexl, "compiling" all the
way down to my two turtles S and C, e.g.:

<http://fexl.com/blog/9>

I'm also relying on two higher-level combinators L and R to reduce the size of
the combinatorial forms, e.g.:

<http://fexl.com/blog/10>

The bottom line is that the entire Fexl parser is defined in terms of the two
primitive combinators S and C.

~~~
iam
I was confused a while till I saw you talking about Moses Schönfinkel. From
everything I've seen people usually refer to those as SK combinators not SC
combinators.

~~~
fexl
Right, that's "K" as in "Konstanzfunktion" in the original German. The book
"From Frege to Gödel" uses "C" as in "Constancy Function" in English, and I
got in the habit of using that.

------
binarymax
I don't fully understand lambda calculus, but i inferred a stack overflow from
his tattoo?

Went to buy the book and its beyond my budget at the moment ($215 on Amazon).

~~~
mindcrime
$215? When I clicked through to the book, I see "Available from these sellers.
9 used from $597.95"

WTF?!??

<http://www.amazon.com/gp/product/0444875085>

~~~
nitrogen
Click on the hardcover edition link.

~~~
mindcrime
Aaah, I see.

Still, I give a big "WTF?!??" to the idea of paying $597 for any version of
this book. I mean, I'm sure it's a good book, but $597 worth????

Heck, even $215 seems a bit crazy.

------
joelhaasnoot
"Barendregt is a helluva drug."

Not sure I agree: his lectures are quite sleep inducing these days. Though
reducing programming to something so simple and mathematical does open lots of
possibilities...

~~~
mattmight
That thick yellow book rocked my world once upon a time.

Never saw him lecture though.

~~~
joelhaasnoot
He teaches classes at the Radboud University in Nijmegen, the Netherlands,
specifically my "Languages and automata/machines" class. He has a "zen"
something going on with lots of interesting comments.

------
iam
Nothing like posting a picture of the y-combinator on a ycombinator.com site
:)

