We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Stack Overflow

So the stack is great and all, but one of the downsides is that it has a limited size. If you keep pushing frames onto the stack without popping them off, you'll eventually run out of memory and get a stack overflow. (yes, that's what the famous site is named after)

That's one of the reasons recursion without tail-call optimization can be dangerous. Each recursive call pushes a new frame onto the stack, and if you have too many recursive calls, you'll run out of stack space.

Assignment

Sneklang is admittedly a fairly inefficient language (don't tell the VC investors!). Sometimes, rather than carefully managing memory, the Sneklang interpreter allocates a big chunk of stack data – simply because the creators (us) are too lazy to allocate the right amount.

Anyhow, the BDFL of Sneklang has allowed this laziness, but only to a maximum amount of 10 kibibytes. A single kibibyte is 1024 bytes.