3 ms·
If you like this subject, I wrote a quicksort in lambda calculus in Python: https://news.ycombinator.com/item?id=38848905 https://news.ycombinator.com/item?id=3
by lucasoshiro 2y ago
If you like this subject, I wrote a quicksort in lambda calculus in Python: https://news.ycombinator.com/item?id=38848905 https://news.ycombinator.com/item?id=38848905
- marvinborner 2y agoThis looks great! Bruijn actually has something similar in its standard library [1] but without your `partition`, so it's much less efficient. [1]: https://bruijn.marvinborner.de/std/List_Church.bruijn.html#sort-asc https://bruijn.marvinborner.de/std/List_Church.bruijn.html#s...
- BlobberSnobber 2y agoUnrelated comment: I love the Tex in your code comments, and I wish that auto-previewing it was a feature of IDEs (especially emacs)
- dunham 2y agoIt's not quite a preview, but back in the 90's there was something called sym-lock.el that would render TeX escape sequences as the corresponding symbol. I have no idea if it still works, but Google points me here: https://github.com/sid137/emacs/blob/master/sym-lock.el (I used it with xemacs at the time, because it had more flexible font handling.)
- karthink 2y agoEmacs can do that quite easily[1]. But this code is not merged into the trunk yet, it should be some time this year. [1]: https://share.karthinks.com/prog-preview-3.mp4 https://share.karthinks.com/prog-preview-3.mp4
- BlobberSnobber 2y agoThat's exactly what I had in mind, is it just a modified org-latex-preview that works anywhere?
- lucasoshiro 2y agoThanks! PS: Nice work :-)
- dunham 2y agoNice. Last November I wrote a implementation of a type checker for the STLC in typescript using mogensen-scott encoding. The idea is that data is represented by its eliminator, so you kind of get pattern matching in javascript. I had been playing around with the idea and thought I'd try a larger example to see how painful it was to work with. I don't think I would build anything bigger with that technique, though. https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67d192e73234 https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67d1...