by utterwise · 3y ago · 0 comments
Closures are just functions with an extra parameter for the environment (free variables). Subsequent passes after desugaring can treat them like any other function.
Function composition and currying should also be static transformations. Maybe you made it harder than it has to be?
Implementing these things is maybe easy for you ;) but for myself, doing it well, I would definitely not describe as a walk in the park
My main objection to the grand parent is the idea that functional languages are 10x more difficult to implement than mainstream languages. Maybe that is true for Haskell, but most functional features can be compiled efficiently without much additional complexity. The complexity added by closures for instance would be closer to 1% than 10x.