Code Will Eat Itself

Code Will Eat Itself

To prove the undecidability of the halting problem you have to feed a program its own source code as input. Sometimes this can be done by reading data from the filesystem, but Kleene’s recursion theorem guarantees that a program can always calculate its own source code without relying on external storage.

This talk shows how to extend any Ruby program with a local variable containing its own source.

A lightning talk given at Scottish Ruby Conference 2013 (http://lanyrd.com/2013/scotruby/). There’s a video of this talk at http://codon.com/impossible-programs. This talk is adapted from chapter 8 of Understanding Computation (http://computationbook.com/).

Cd9b247e4507fed75312e9a42070125d?s=128

Tom Stuart

May 13, 2013
Tweet