Intro to Functional Programming via JavaScript
This is purely an academic exercise. Adam contacted recently with a link to a blog post on implementing the Y-combinator in JavaScript. There were a whole bunch of words that sound smart, such as
- Recursion
- Fixed point
- Y-combinator
- Memoization
It’s like a professor’s dream come true. I had seen the article a long time ago when I prepared a presentation for work about functional programming. Basically, it was an introduction to functional programming, and to help myself learn, I decided to take the extremely low-level paradigms in functional programming and implement them. JavaScript seemed like the natural language choice, since of the three languages I know pretty well (PHP, JavaScript, C#), it was the only one that supported closures in a convenient way. Sold.
Anyway, here’s the presentation. You just might learn something.
Reference articles:
- Implementation of Recursive Fixed Point Y-Combinator in JavaScript for Memoization (it’s a mouthful)
- Generating Church Numbers With JavaScript
January 2, 2010
Posted in: javascript

Leave a Reply