Re:Power of Small Optimizations
by zmgsabst on Saturday February 10, 2024 @10:22AM
(#39326757)
I think you can allow finite recursions, eg, a maximum stack depth.
[ Parent
| on HN ]
Re:Power of Small Optimizations
by The_Colonel on Sunday February 11, 2024 @02:18PM
(#39337698)
But then reaching it will mean a crash. I could use a similar approach to say that any program will terminate if I set a fixed time (instruction count) limit.
Yes — that’s correct.
Programs with a fixed amount of execution time always terminate. That’s why we add timeouts to executions, because they’re a solution to the halting problem, which guarantees execution flow of our machines always returns at some point.