The lambda envs could be created on the stack and only moved to the heap if the lambda is copied.
The type of a lambda literal would change to a ref to a function (which would make them immediately suitable to pass as function arguments in most cases.)
Love that, on my current project I have a few allocations in the critical path because closures were easier to use than the alternative. This proposal would remove them.
The lambda envs could be created on the stack and only moved to the heap if the lambda is copied.
The type of a lambda literal would change to a ref to a function (which would make them immediately suitable to pass as function arguments in most cases.)