Scooping the Loop Snooper


In the following video, I read a rhyming poem about a popular part of computability theory, the Halting Problem.

Find the original poem here: http://www.lel.ed.ac.uk/~gpullum/loopsnoop.html

The halting problem is an interesting part of computability theory. It tells us that there's no way, using a certain type of computer, to be able to always detect if a given program will eventually stop running.

Although it's often attributed to computer science hero and queer icon Alan Turing, the problem was first stated in the 1950s by a mathematician named Martin Davis.

It's an abstract idea, but it has real-world impact.

Computing worked differently in the fifties. This was before time-sharing, so each (large, expensive, fragile) computer could essentially only run one program at a time. A program was fed into the machine, and it cranked away before producing a result. Programs could potentially run for hours or days before successfully completing. During that time no other programs could be executed. Long-running programs can create a bottleneck, with many others waiting to run.

As you can imagine, an infinite loop was an expensive problem, as the program could run for a long time without anyone realizing it's gone wrong. Eventually, either the machine breaks (very common in the era of vacuum tubes) or the operators manually halt the machine because they realize something's gone wrong.

An effective and cost-saving way of avoiding this was manual review of the program's code before running it. An engineer looks at the code and tries to figure out what will happen as the computer executes it. A lot of time, this process can detect an error before the program starts to run, which is the best time to find a bug.

But engineers are human, and they make mistakes. That's why we have these infinite loops to begin with. The manual review process occasionally overlooks bugs. So why not get a static analyzer to detect them for us, a machine that looks at the software and detects issues? Well, we have done just that. These are amazing tools and I love them.

So the halting problem shows us that these analyzers can never be perfect. Due to the dynamic relationship between code and its input data, it's impossible to know (with total certainty) from the code alone whether an infinite loop won't occur.

As a side note, because it's a work of computability theory and mathematics, none of this work tends to address many external factors that can cause a computer glitch to occur, such as hardware failures, environmental factors, and malicious actors.

#video #computers