Have you tried to share any Hackdoor article on Facebook, Twitter, Reddit, etc.?

If you haven’t, you should try right now with this article! 😛
I’m saying that for a reason: you will notice that this article open graph image will look like this:

If you are an Hackdoor author, you may also have noticed that if you change your article’s title or image, the open graph image will immediately reflect those changes.

Well, that’s because, at Hackdoor, we’re using Gauguin!

There’s an Italian Facebook page called “Il Programmatore di Merda” (which can be translated to “The Shitty Programmer”). I love that page.

They often share shitty pieces of code and memes about programming, but today I’ve seen something quite incredible:

New to Lambda Calculus? I’d recommend reading Lambda Calculus in JavaScript before continuing!

The Y Combinator is a fixed-point higher order function which is used to implement recursion in any programming language which does not support it natively.
It has been introduced by the mathematician and logician Haskell Curry in 1940’s and is considered to be one of the most beautiful ideas in programming and logic.
We’ll see how to implement that amazing piece of code in 6 programming languages:

  • JavaScript
  • Haskell
  • Java
  • Racket
  • Python
  • C

Original Y Combinator in Lambda Calculus

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…

Michele Riva

Senior Software Engineer @ViacomCBS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store