Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The very first sentence;

> The λ calculus is, at heart, a simple notation for functions and application.

I'm already confused! and application. Does that even make sense? It didn't get much better when I started on the first chapter. It seemed like an exercise in making simple algebra much more complicated, for philosophical reasons, or something.

I've no doubt at all that lambda calculus (whatever it is) is extremely important and valuable and if I put in the work and broke through the barriers I'd be embarrassed about my last paragraph.

But still, is there no way to introduce the subject in a slightly less obtuse and confusing way?



With "application" they mean "function application" (aka. calling a function).

But I feel you. I'm sure there is a less academic way to explain this stuff.

Do you know Lisp or Clojure? Then you already understand lambda calculus.

Do you know JavaScript? Then replace all those lambdas with arrow functions:

    (λ x . x + 2) 1
becomes:

    (x => x + 2)(1)
So lambda calculus "programs" are just a bunch of these nested immediately invoked anonymous functions. You could run that by just pasting it into the web console / NodeJS REPL.

Like Turing machines, this is a general model for computation. But it's conceptually much simpler and easier to reason about mathematically.

Each computation step comes down to rewriting the program. That's just like computing algebraic expressions on paper:

      (1 + 2)x - 2x
    = 3x - 2x
    = x
sum up something there, multiply out here, ...

In the lambda calculus you can do the same but you have "applying a function" as a step that you can do:

      (λ x . x + 2) 1
    = 1 + 2
    = 3


Thanks. Sadly I'm an old school assembly, C, C++ type. I don't know Closure or Haskell and my attempts to write Javascript always involving basically writing C in Javascript.


If you're confused by a mathematical or technical text, it can help to simply accept that, and read on for a bit (I've heard from professional mathematicians that this is commonplace in their readings)

In this case, we find after the abstract and the contents list that the idea is that a function is a general expression like x^2+1, with a variable x. Applying this function to an argument, e.g. 2, results in the value 5.

Edit: So that should make sense of the idea of a function, on one hand, and the application of the function, on the other.

The idea behind lambda calculus was to come up with a certain primitive set of operations that were precise enough that they could be defined mechanistically (and this was before the days when computers existed that could carry these out mechanistically), but also were rich enough that they could be used in combination to compute any function hitherto devised


Thanks, so application comes down to plugging in values, I got as far as "plugging in values" in the subject document (except that I didn't realise that's what application meant).

Then I kind of recoiled from reforming, say f(x) = x^2 + 1 so f(1) = 1^2 + 1 = 2 into something seemingly more complicated for reasons that are difficult to discern for me as a reader and no doubt difficult to describe as an expert writer. I have the same difficulty with your last paragraph.


The idea is that it's a set of basic rules that can be used to model any computation (lambda calculus is Turing-complete). So think of it as a programming language with a very minimal set of primitive/builtin operations, which is really what it is.

The reason things can seem more complicated than they need to be is that this set of primitive operations is so minimal; and the reason it's so minimal is that Alonzo Church came up with it in the 1930s when they were trying to get to the very bare bones of the concept of computation.

Lambda calculus is the grandfather of all functional programming languages. Lisp was a more or less direct implementation of it


I wouldn't be surprised if there were a much more clear and concise way to introduce it, but on the other hand, the topic doesn't seem all that useful to someone without exposure to some fundamentals, so it seems fine to me if it has a bunch of jargon. Lambda calculus programs that actually do something useful are extremely weird and hard to read and write, even very simple ones, so that's not where its value comes from. Probably a better thing to learn in connection with stuff like interpreter and compiler design when it isn't weird to say "function application" and expect you to know what that is.


The host site plato.stanford.edu is an encyclopedia written by academics, and suffers from academic culture's predeliction for abstruse writing as false precision.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: