We should just solve the halting problem. The we'd no longer need to implement automatic storage duration and call frames by using stacks. It's just that easy.
We should just solve the halting problem. The we'd no longer need to implement automatic storage duration and call frames by using stacks. It's just that easy.
And this is a real option. While determining the maximum stack size of an arbitrary program is halting-problem-equivalent (requires determining the maximum depth of the runtime call graph), we can trivially choose to write code where determining the maximum stack size is also trivial. This static analysis is commonly done on embedded systems, and essentially comes down to "don't write code that you can't guarantee the correctness of", which should be starting stakes anyhow.
That might be a little bit like "draw the rest of the damn owl" and besides, wouldn't that destroy our encryption schemes?
It's currently unsolved, but I don't think that it's been proved to be unsolvable as surely that would prove P ≠ NP. The connection to encryption is that integer factorisation could then be solved in polynomial time which would break current systems, though in theory a much longer key length could be used to try to outpace computer power, especially if the polynomial algorithm is hugely inefficient.
Edit: I see that the halting problem has indeed been proved to be unsolvable and it doesn't imply P ≠ NP
Edit: it wouldn’t be a stretch to call it the most important result in all of mathematics
There is a solution to the halting problem. It’s that it is undecidable.
Of course, if it has to be explained it loses its funny.