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 https://tomstu.art/impossible-programs. This talk is adapted from chapter 8 of Understanding Computation (http://computationbook.com/).