Lambda Calculus in JavaScript?

Michele Riva
openmind
Published in
5 min readJun 16, 2019

--

Lambda Calculus is a formal system in mathematical logic introduced by Alonzo Church in the 1930s.
It’s getting more and more attention these days thanks to the rise of the Functional Programming paradigm in a growing number of languages (Scala, ReasonML, etc), and guess what? Functional Programming is all based on Lambda Calculus.
So, in order to understand what Functional Programming is, let’s see what Lambda Calculus looks like… but in JavaScript!

Why JavaScript?

Did you know that JS was built with the goal of embedding the Scheme Programming Language into the Netscape Navigator web browser?
And guess what! Scheme is a functional language! So JS still has some Functional Programming features that will help us a lot during our everyday work!

Getting Started

As written above, Lambda Calculus is a formal system for expressing computation, and it’s based on the concept of expressing and composing functions.
An expression may be a variable, an abstraction, or a function application.
To be more clear, we can summarise these three concepts the following way:

Variable

--

--