I read Ken Thompson's classic paper Reflections on Trusting Trust in which he prompts users to write a Quine as an introduction to his argument (highly recommended read).

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

The naive approach is simply to want to say:

print "[insert this program's source here]"

But one quickly sees that this is impossible. I ended up writing one myself using Python but still have trouble explaining "the trick". I'm looking for an excellent explanation of why Quines are possible.

Edit
Report