3 ms·
Original Fortran compilers were able to tell exactly how much stack any program was using. The answer was zero as all local variables were allocated statically
by fpoling 8y ago
Original Fortran compilers were able to tell exactly how much stack any program was using. The answer was zero as all local variables were allocated statically and recursive calls were not supported.
But one does not need to go to such extreme as many useful code patterns can be proven to be stack bounded and for the rest of code the compiler may require runtime checks or some annotations like Rust’s unsafe.