10 ms·
C is just implicit about how it pushes each function-local variable onto the stack. No amount of compiler optimization can hide it completely -- recurse too muc
by gary_0 5y ago
C is just implicit about how it pushes each function-local variable onto the stack. No amount of compiler optimization can hide it completely -- recurse too much or use up all the space, and you'll get a stack overflow. And just below C, all mainstream ABIs are designed around a stack too (with a designated stack pointer register, etc).
- kazinator 5y agoC has activation frames allocated in a LIFO discipline for supporting recursive functions, implemented using a stack; but I think that is not what we mean by "stack language".