To return an answer, he must evaluate the expression, do it so that he evaluates the internal expression, do it so that he evaluates the internal expression, do it so that he evaluates the internal expression.
Usually, when the debugger hits the stack (there are too many nested frames of the stack), people send errors to the development team that writes the debugger. They fix the problem using only the means known at that time: no recursion.
If you could evaluate how deep the stack should go without evaluating the expression in a nested manner, for any recursive expression; A brilliant Fields Medal awaits there (and probably the university is ready to build a new building in your name). This problem is connected with the stopping problem , and, unfortunately, with our computational model it is known that the stopping problem is unsolvable.
source share