3 ms·
> The stack has the requirement that its size must be known at compile time for each function. Not really. You can bump your stack pointer at any time. Even C
by morelisp 5y ago
> The stack has the requirement that its size must be known at compile time for each function.
Not really. You can bump your stack pointer at any time. Even C has alloca and VLAs. In lots of languages it's dangerous and not done because you can stack overflow with horrible results, and some (but not all) performance is lost because you need to offset some loads relative to another variable value, but you can do it.
What the stack really has a requirement that any values on it will go full nasal demon after the function returns, so you'd better be absolutely certain the value can't escape - and detecting that is hard.