3 ms·
> Dana smirks. “Well, yeah. JavaScript is an eager language. Can’t use the Y combinator.” Does anyone know off the top of their head if the Z combinator would
by mrkeen 1y ago
> Dana smirks. “Well, yeah. JavaScript is an eager language. Can’t use the Y combinator.”
Does anyone know off the top of their head if the Z combinator would just work here? (Instead of switching to Skoobert)
- eru 1y agoYou can make the Y combinator work in eager languages. Famously, in Scheme and other Lisps. This website we are discussing on is written in a sort-of Scheme dialect.
- zelphirkalt 1y agoYep. The comment about eager languages I think is not really correct, as their eagerness is not really the problem. The problem is being bad at recursion and not having TCO, thus running into a stack overflow. But maybe even more correct would be to say that this or that JS engine doesn't implement TCO. Would Y have simply worked in Safari?
- joshmoody24 1y agoThe Z combinator does work, but when you try to convert it into point-free form it starts crashing again. I tried pretty hard to avoid having to rewrite JavaScript for this article, but I couldn't find a way around it, since one of my constraints was making everything point-free.