5 ms·
Had never heard of the lambda calculus before. Very cool. Does it have any practical applications? Or is it mostly a theoretical / conceptual tool?
by mgalka 11y ago
Had never heard of the lambda calculus before. Very cool.
Does it have any practical applications? Or is it mostly a theoretical / conceptual tool?
- readymade 11y agoYou'd rarely want to write lambda calculus directly for practical purposes, although Caramel looks like a very nice shorthand. But it's the fundamental basis of what functional programming is all about, and its equivalency to the turing machine means it's useful both as an analytical tool and in the context of language design. Functional languages can be seen as lambda calculus implementations with some extensions to make it easier to work with (types, constants, etc).
- tikhonj 11y agoIt's mostly a theoretical tool: it's an incredibly simple programming language, which makes it easy to design and evaluate language features in isolation. That's a powerful property! At the same time, practical functional languages are often surprisingly limited extensions of an underlying lambda calculus, perhaps with types. In fact, Caramel is more or less what an untyped Haskell or purely functional subset of Scheme would look like with fewer parentheses and macros.
- imakesnowflakes 11y ago>which makes it easy to design and evaluate language features in isolation. Where can I see a demonstration of this? For example, what does it mean to evaluate something like decorators in Python and how will one go about doing that with lambda calculus?
- tikhonj 11y agoDecorators in Python are basically special syntax for higher-order functions, so I don't think there's much there to evaluate. The lambda calculus is usually used when you want to ignore syntax. Introductory resources on programming language theory usually have examples, after giving you a thorough grounding in the basic untyped lambda calculus. In particular, this is how they usually introduced type system features, but there are interesting things like continuations that don't necessarily involve types. Types and Programming Languages by Benjamin Pierce is a great resource, but you can probably find free lecture notes to the same effect. (I'd look them up, but I'm on my phone so it's a bit of a hassle.) The most interesting non-introductory (but still self-contained) example I've seen was Barry Jay's Pattern Calculus book. He introduces pattern matching and first class patterns, first without types and then with, all building upon the lambda calculus. His ideas cover functional, imperative and object-oriented features, and it's fascinating to see a whole language developed piece-by-piece like that. If you're curious about PL theory and want to dive pretty deep, I think this is a book worth looking at.
- syllogism 11y agoTheories of grammar that compile natural language to the lambda calculus are popular in computational linguistics. For instance, this won the best paper award in EMNLP 2015, the most recent top-tier conference in the field: Broad-coverage CCG Semantic Parsing with AMR Yoav Artzi, Kenton Lee and Luke Zettlemoyer http://yoavartzi.com/pub/alz-emnlp.2015.pdf http://yoavartzi.com/pub/alz-emnlp.2015.pdf
- eru 11y agoYCombinator is named for the y combinator of lambda calculus.