Hacker News new | past | comments | ask | show | jobs | submit login

I don't think it can be boiled down to a performance cost issue. If a program is going to run forever, how do you measure the forever has passed to conclude the program doesn't halt?



By waiting forever.

I understand that "forever" is a nebulous term, but it works both ways. We both know that no computer program could actually run forever.


> I understand that "forever" is a nebulous term, but it works both ways.

So, at what point in time the person who is observing a running program is going to declare it doesn't halt? What if they conclude the program doesn't halt, just for it to actually complete execution the very next second?

In practical terms, that's why we have timeouts. And in some cases relying on a reasonable timeout is fundamentally the best we can do -- exactly because we can't deterministically answer if a program ever halts.

> We both know that no computer program could actually run forever.

No program can actually run forever, of course. But any program will stop eventually due to external factors -- me hitting Ctrl + C or pulling the power plug or whatever. The halting problem asks whether it's possible to tell if a program will ever stop or not according to its internal logic.

Here's a (likely dumb) analogy off the top of my head regarding a program stopping due to external reasons. Imagine, I toss a coin, lightning strikes and evaporates the coin while its midair. Do I get to say it was heads or tails? Guess, it's impossible to claim either way.


> So, at what point in time the person who is observing a running program is going to declare it doesn't halt?

That "point in time" is within time itself condition on the program halting. If the program never halts, then that point in time is "never". We might disagree on whether "never" is a point in time at all... We might even disagree on whether "never" as a concept even exists or makes any sense.

Yet as you say, all programs will halt, one way or another. You divide such factors into "internal" vs "external", but if we really think about, no computer program is an island; Computation is a property of the material universe. I wouldn't be so quick to draw the distinction between internal logic and external interference. The program itself wouldn't exist without external input, and its result is only meaningful in the context of the reality to which it has effect.

I understand the nature of the abstract philosophical academic conundrum, but also that it's a flawed and incomplete way of modeling real world concepts. To me the halting problem is a practical engineering one; A matter of performance. A faster way to find the same answer, i.e. optimization.

Consider internal errors as well. The computer can have a hardware bug that causes the program to never halt even if in theory it should. Internal interference in the flow of electrons within its circuits could throw it off. The coin in your example could be faulty, and shatter due to internal tensions upon landing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: