Re:Don’t Think, Just Defunctionalize
by CyberRabbi on Wednesday December 23, 2020 @02:37PM
(#25521246)
Right... probably nearly every language has a poor call stack overflow recovery story, not only because of non-heap stacks but I don’t think it’s relatively straightforward to get the program back into a well defined state after call stack overflow. Those errors can happen on any line of code so unless every line of code is guaranteed to be atomic and a coherent state can be derived from the intermediate states, the program will be in an undefined state.
By the way, Haskell has stack problems as well when evaluating thunks. Hence the strict foldl’.
https://wiki.haskell.org/Stack_overflow