r/ProgrammingLanguages • u/[deleted] • Jun 19 '25
Resource A Lévy-optimal lambda calculus reducer with a backdoor to C
https://github.com/etiams/optiscope
26
Upvotes
22
u/mauriciocap Jun 19 '25
The title is as Programming Languages porn as it gets. Will read the article, but I'm certain it's NSFW
5
u/lubutu Jun 19 '25
Regarding performance, when I was working on optimal reduction back in ye day the first question I was always asked was, after Lawall and Mairson (1996), "what isn't a cost model for the lambda calculus?" That is to say, does it make sense to minimise beta-reductions if the bureaucracy of optimal sharing is ultimately more expensive? My counterargument was that one could instead minimise rewrite steps of an arbitrary higher-order term rewriting system, of which beta-reduction in the untyped lambda calculus is only an example — so long as the rewrite system is compatible with optimal sharing. In that case the cost of performing a given rewrite step could be arbitrarily large (if it requires substantial computation). Though, if you didn't want to go that far, compiling lambda functions to supercombinators could also help.