Skip to content
0:00 / 0:00

#lambdacalculus#haskell#ast

Stephanie Weirich - How to Implement the Lambda Calculus, Quickly

Konfy

4K subscribers • 13 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Stephanie Weirich
  • Linked in the descriptionsweirich/lambda-n-ways

Intermediate. Assumes working knowledge.

2.4K views3 years ago1 recommendation

Programming languagesComputer scienceHaskellLanguage design and type systemsCompilers and interpreters

Stephanie Weirich compares different Haskell implementations of alpha-equivalence and capture-avoiding substitution in the lambda calculus.

Special thanks to the Haskell Foundation for supporting the production of this video! Haskell Love 2021 schedule: emamo.com/event/haskell-love Haskell Love twitter: twitter.com/_haskellove Alpha-equivalence and capture-avoiding substitution are two fundamental operations in the implementation of the lambda calculus. But, what is the best way to implement these operations in Haskell? I wish I knew. In this talk, which is part tutorial and part work-in-progress, I'll present what I have learned from gathering many, many implementations of these operations into the same repository and comparing their execution using a small benchmark suite. One observation to make is that that most of these implementations of capture-avoiding substitution require multiple traversals of the AST, which can lead to a significant slowdown on larger examples. However, by reifying, delaying, and fusing these traversals, we can dramatically improve performance. Not only that, but I will also show how this optimization can be invisibly incorporated into binding libraries that automatically provide capture-avoiding substitution "for free". Link to benchmark repository: github.com/sweirich/lambda-n-ways

Why it's here

1 person recommends this

u/mttdin r/ProgrammingLanguages • Recommends

Stephanie Weirich - How to Implement the Lambda Calculus, Quickly

u/Deonisosin r/functionalprogramming • Mentions

On “When does Variable Capture happen in substitution?”

Apart from avoiding variable capture, it's supposed to be faster? Or takes less ressources when having a lot of recursion? **I just can't imagine a scenario in wich many lambda functions with the same parameter name would occur so that it would matter.** Isn't the programmer supposed to pick a different name for most variables anyway? These are my sources so far: youtube.com/watch?v=uhGqJ1A\_PRE chargueraud.org/research/2009/ln/main.pdf boarders.github.io/posts/locally-nameless.html