3 ms·
I don't know if it will work for you, but I wrote a Quicksort using lambda calculus in Python, and I explained the process of writing it here: https://lucasosh
by lucasoshiro 2y ago
I don't know if it will work for you, but I wrote a Quicksort using lambda calculus in Python, and I explained the process of writing it here:
https://lucasoshiro.github.io/software-en/2020-06-06-lambdasort/ https://lucasoshiro.github.io/software-en/2020-06-06-lambdas...
Please note that I'm not an expert in lambda calculus, just a curious nerd and it won't explain everything, like the reductions, combinators and so on. But there I explain how to implement simple types (int, boolean, pairs and lists) using Church encoding, let expressions and recursion using the Y combinator (yay, I finally used the expression "Y combinator" on HN!). Everything that we need to implement a quicksort (which is a relatively complex algorithm) using the almost nothing that we have in lambda calculus.
Another point is that it's all implemented in Python, using the Python notation instead of the lambda calculus notation, so you can run the code in your machine and play with the examples
- Joker_vD 2y agoSorry, I meant binary λ-calculus specifically. I can't quite wrap my head around what the hell it even does with its I/O.
- tromp 2y agoIf the IOCCC description [1] doesn't make it clear enough, perhaps this explanation [2] does it better? I also link to a Pi Day 2023 talk trying to explain it on my lambda playground page [3]. [1] https://www.ioccc.org/2012/tromp/ https://www.ioccc.org/2012/tromp/ [2] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d861 https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8... [3] https://tromp.github.io/cl/cl.html https://tromp.github.io/cl/cl.html