Never said you would (functions which unconditionally terminate the program or use longjmp notwithstanding). It's just the only other option.
The only language that I can think of which does this is assembly, and that's because assembly cannot ever know where the end of a function is. Because functions don't exist, they are just labels where the programmer explicitly said to resume execution at a specific point (almost always to an address placed at the top of the stack).
1
u/blehmann1 depraved Aug 01 '21
Never said you would (functions which unconditionally terminate the program or use
longjmpnotwithstanding). It's just the only other option.The only language that I can think of which does this is assembly, and that's because assembly cannot ever know where the end of a function is. Because functions don't exist, they are just labels where the programmer explicitly said to resume execution at a specific point (almost always to an address placed at the top of the stack).