Hacker News new | ask | show | jobs
by dewster 3617 days ago
Again, I'm most likely an idiot, but I'm just not seeing it in any of the examples I've encountered. Not trying to be dense, I realize the onus is mostly on me here, and I really am interested in fundamentals. Just wondering if there is a better example of why I should go out of my way to understand lambda calculus, cause this one ain't cutting it. LC may well indeed form the basis of everything CS - if so why doesn't it seem very impressive at first (and second, and third) sight?
2 comments

> why doesn't it seem very impressive at first (and second, and third) sight?

That's a super interesting question. Pretty much the entire challenge of LC is coming to understand why it's interesting. From our perspective, so far past the consequences of this discovery, it will all seem too obvious to state. The interestingness of LC comes out of it being so austere and so powerful.

Frankly, this page's intro to it is sort of terrible. Clojure is too powerful and clunky to point directly at LC and show why it's interesting.

LC is a language with three constructors

    var[x]         reference a name
    lam[x](...)    create a scope where x is *known*
    app(f, v)      when f is lam[x], give 
                   meaning to x within its body
Forget ideas of functions or anything else you know from CS. Just think about what these three constructors mean. To give them real meaning we have to define one more thing: the reduction step. It's what you think it is

    app(lam[x](body), value) ==> body{x -> value}
where the right side means that we replace all instances of "x" within "body" with "value".

So imagine that to be the definition of a programming language---the whole thing. It seems a bit silly. It doesn't obviously have any of

    - numbers
    - if-the-else
    - for loops
    - recursion
    - mutation
    - data types
 
It doesn't even seem to have any way of talking about how it instructs a machine on what to do. It's truly austere.

So the magic, of course, is that it actually does have all of the above. Those 3 constructors and one rule are powerful enough already to generate all of that.

That's what's remarkable.

If you work in a big company making internal web apps for HR to manage payroll, then no, the lambda calculus will never be useful to you.

However, if you want to do research, it is an invaluable model of how computation works. It's simplicity allows for reasoning about complex ideas while minimizing the cognitive overhead of the model.

It may also help you understand why certain functional styles behave the way they do or how to better implement programming languages.

If none of those things interest you, then yes, it is not useful. But a large crowd here IS interested in computer science theory and programming language theory and functional programming so they are interested.

As a final analogy, you might consider this the 'Standard Model' of computation much like there is the Standard Model in particle physics. If you are a civil engineer, it will never be useful. If you are a chemist, it might be useful only in passing. But if you are the physicist, it is invaluable.