Word of the Week: Quine

In computing, quine is a program that produces its complete source code as its only output. For amusement, programmers sometimes attempt to develop the shortest possible quine in any given programming language.

Note that authoring the program to seek out and read its own source file to print is considered cheating.

Quines are named after philosopher Willard Van Orman Quine (1908–2000), who made an extensive study of indirect self-reference. He coined, among others, the following paradox-producing expression, known as Quine’s paradox: “‘Yields falsehood when preceded by its quotation’ yields falsehood when preceded by its quotation.”

Here’s one example of a quine in BASIC:

10 LIST

I found many samples of quines in many programming languages from Gary Thompson’s site, include everything from Ada, Assembly, BASIC, LISP, Javascript, Logo, Perl, Python, Smalltalk and many, many more. Though it appears he’s looking for samples in some of the more, ahem, ‘classic’ languages like COBOL, and others.

References:

- David Madore’s personal collection and tribute page to quines.
- The quine entry of the FOLDOC

About Andy

I'm an eternal optimist, follow a Buddhist philosophy, geek of many areas, practicing yoga and TaiChi, learning the Chinese language, a die-hard sports fan, love politics and nuclear submarines.
Computers, Word Geek

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image