r/ProgrammingLanguages • • May 21 '24

Why do we love the lambda calculus?

I've been reading about some of the more esoteric models of computation lately, and it got me wondering why it is that the lambda calculus is the "default". So much literature has been built up around it now that it's hard to imagine anything different.

Is it merely the fact that the lambda calculus was the 'first to market'? Or does it have properties that make it obviously preferable to other models of computation such as combinators, interaction nets, kahn process networks, etc?

77 Upvotes

62 comments sorted by

View all comments

Show parent comment

2

u/marshaharsha May 30 '24

Can you give examples of how a combinator calculus is “used in a mostly vanilla form to write serious software”? My (very limited) understanding of combinators is that they require horrendously long, obscure chains of symbols just to accomplish simple things. Do you mean they are used as source code or internal representations?

1

u/poorlilwitchgirl May 30 '24

SASL, the first purely functional programming language (which led to Miranda and heavily influenced Haskell), was implemented with SKI combinators (in 1978; the 1972 implementation used a SECD machine), and the entire field of point-free functional programming is based on using combinators as primitives.

The long, obscure chains of symbols are only necessary if you're trying to rigorously prove universality of a minimal basis or something of that sort, but in practical applications, it makes sense to allow yourself to define progressively higher level abstractions in terms of existing combinators, and that's where combinators really shine-- the whole idea behind combinators is that they combine, and the product of combinators can be treated like a brand new atomic operation, whereas the pure lambda calculus has the α-conversion problem because at its core it's just a syntactic substitution process. There are other solutions (like de Bruijn indexing), but in general what we call "lambdas" in practical programming are actually just anonymous functions and not typically based on syntactic substitution, whereas combinators in functional programming are actually mathematically pure combinators.