
the spirit is weak. woe be the spirit. the body is weaker still. Siërra R
.
ask me about horses
.
Wait, now I'm wondering if there's a way to implement loop detection in such a way that the computer just instantly blows a capacitor if a loop runs for too long...
Easily: just construct the rest of the computer out of sufficiently durable parts that they won't break first, then wait.
every program halts given the heat death of the universe
that just puts an arbitrary cap on the number of possible iterations which does inherently solve infinite loops but it also severely hampers computing potential.
related note: when writing a loop a good programmer will always add a loop counter and put an upper limit on the number of possible iterations that exceeds the number of necessary iterations when all values are within usable bounds. effectively using your solution contextually in a way that doesn't limit the computational ability of the entire computer.
I really don't think it's good programming practice to always add a loop counter... I don't want my graph search to terminate early if it hits an arbitrary limit, before it runs out of vertices to expand :p
There's also plenty of use cases for really infinite loops; anything that can in principle run forever intentionally. It would be extremely weird to have a game loop just stop because you left it running, or a network server's socket handler, or god forbid the OS scheduler...
definitely! I kinda implicitly assumed her comment wasn't meant to apply to loops that are truly meant to be infinite, bc like, that would be silly
if the loop counter exits the loop before all of the vertices are expanded that you set the wrong upper bound.
Technically no computers are Turing Complete because nobody has yet implemented an infinite tape.
I seem to recall reading a blog post by notch (before he revealed himself to be an asshole) about a computer that instantly gives a completely random response to any question you ask it, then takes as long as it needs to verify whether the answer is true. If it turns out to be false it kills you.