Get the latest tech news
Crafting formulas: Lambdas all the way down
We build complex mathematical formulas bottom-up using pure lambda calculus. Includes instructions of how to translate Taylor series and other approximations to lambda terms.
Note that all of the definitions (including library imports) have a 1:1 correspondence to pure lambda calculus – bruijn is just syntactic sugar ( syntax explanation). In my experience many readers won’t immediately understand, but working with bruijn and pure lambda calculus in general is really satisfying and enjoyable. If I were to implement something similar in a language like Python or Java, decomposing powers or sqrt into the iteration could even hurt performance, since the traditional functions are already hyper-optimized.
Or read this on Hacker News