Description
I'd like to propose adding a mechanism to Solidity that allows removing variables from the stack. I'm not familiar with Solidity's internals, so I do not have an opinion about how to implement this feature. However, I assume it is possible to implement because Serpent had this feature. For reference, Serpent's with
keyword was used for this:
# nothing on the stack
with x = 1:
# x is on the stack
# nothing on the stack
Motivation: Augur recently completed its migration to Solidity from Serpent. One pain point for us was that Solidity lacks a way of removing variables from the stack. Because of this, the stack depth limit drove a number of architectural decisions (about e.g. how/whether to split up functions) that we would have preferred to make independently of language-level constraints.
(This is related to #2693, but I thought it was worthwhile to make a separate issue for manual stack management.)