3 ms·
I agree that users of a programming language should understand the implementations and costs of its abstractions. That said, I think lambda is an important enou
by cousin_it 12y ago
I agree that users of a programming language should understand the implementations and costs of its abstractions. That said, I think lambda is an important enough abstraction that it should just work as the math says, without arbitrary limitations. Anything less than that is a point against the language. This paragraph from "History of T" [1] is interesting:
> Good Scheme compilers use a range of implementations for the lambdas in the program, depending upon what they can determine about the lambdas at compile time -- how they're used, to where they are passed, the relationship between the uses and the definition points, etc. Some lambdas just evaporate into nothing. Some lambdas turn into control-flow join points with associated register/variable bindings. Some lambdas turn into stack frames. But some lambdas cause heap allocation to produce general closures.
[1] http://www.paulgraham.com/thist.html http://www.paulgraham.com/thist.html