Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsA quine is a program that prints its own source code when run. It does not need to contain an infinitely nested copy of itself: a quine can split the job between a template for its source and a function that turns that template into a correctly quoted string. That small programming puzzle is related to, but different from, John von Neumann’s model of machines that construct and reproduce automata—and from worms that copy themselves between computers.
What a quine does—and what it does not
In the usual strict sense, a quine is a self-contained program whose output is its own source. It is a puzzle about self-reference: the program must produce the text that describes the program, including the instructions that produce that text.
As an Amazon Associate I earn from qualifying purchases.
That definition is narrower than “code that copies itself.” A script that duplicates a file, reads its own source file, or spreads to another computer may copy code, but it is not necessarily a quine in the conventional puzzle sense. Here, “quine” means a program that generates its source as output without relying on a special self-listing command or inspecting its source file at runtime. Ben Lynn’s Stanford-hosted explanation of quines discusses the distinction between strict constructions and looser examples.
How can a program print itself without containing itself?
A naive attempt runs into an apparent loop. A print statement can output a string, but if that string omits the print statement, it is not the whole program. Add the print statement to the string and the string must then include itself, apparently requiring another copy without end.
#1 Best Overall
The way out is to divide the source into two cooperating pieces:
- A constructor emits the fixed program structure.
- A copier converts a source template into a valid string literal—adding the quoting and escapes needed for that template to appear as data in the output.
The program combines the template and its quoted representation. The template supplies the program’s shape; the copier supplies a printable representation of the template. Together they generate one complete copy of the source, rather than embedding an infinite series of copies inside the source.
In the Haskell example explained by Lynn, the built-in show function provides the string-quoting operation, and the program combines that result with output. The important idea is not a particular language feature: a quine needs a way to represent its template as data and a way to assemble that representation into the final source text.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteHow von Neumann’s automata extend the idea
Von Neumann’s self-reproducing automata address a more ambitious question than “How can text print itself?” They model machines that can construct another machine and provide it with the description needed to operate. The key conceptual division is between constructing the machine and copying its description.
Rank #3
In the simplified account in Lynn’s explanation, a universal constructor interprets a description to build a machine, while a universal copier duplicates the description. The constructed machine receives the copied description. Because construction and description-copying are separate functions, the original machine need not contain an endlessly nested description of itself.
Von Neumann’s goal was not merely a clever text-output trick. His work considered machine reproduction and the possibility of evolution. The book Theory of Self-reproducing Automata, authored by John von Neumann and edited by Arthur Walter Burks, was published posthumously by the University of Illinois Press in 1966; its Google Books record lists 388 pages.
Rank #4
What the historical automaton counts mean
A 1966 abstract for Simple self-reproducing universal automata reports that von Neumann and Thatcher had shown self-reproducing universal arrays could be built with finite automata of 29 states. The abstract then describes a different construction using a basic finite automaton able to execute an internal program of up to 20 instructions. These are specific figures from that paper’s abstract, not general limits or typical counts for quines or self-replicating systems. See the Elsevier abstract.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Quines, automata, and worms are not the same thing
These examples are related through self-reproduction, but they differ in what gets copied, where the copy goes, and whether the process propagates to another host.
Best Value
| Example | What is copied or produced | Where it goes | What distinguishes it |
|---|---|---|---|
| Quine | The program’s source text | Its output | A self-contained source-generation puzzle; it need not construct or infect another system. |
| Von Neumann automaton | A machine, along with a copied description used in its construction | A newly constructed machine | Separates construction from copying the machine’s description; the theory also considers evolution. |
| Worm | A program copy | Another computer or host | Its behavior involves moving or copying between computers; that alone does not establish malicious intent. |
Why self-copying does not by itself mean malware
IBM’s historical account describes Creeper as an experimental program Bob Thomas created in 1971 to move between ARPANET computers. Ray Tomlinson later modified it so that it also copied itself between computers. IBM says Creeper was not malware because it was not intended to damage or disrupt systems. That history makes it a useful example of why copying behavior and malicious purpose are separate questions; it does not make every self-replicating program a worm or a threat. Read IBM’s account of Creeper.
A modern research example: a neural network that outputs its weights
Self-reproduction need not mean printing source code. In a 2018 paper, *Neural Network Quine*, Andrew Chang and Hod Lipson explored neural networks trained to output their own weights. One design also attempted to classify handwritten digits from the MNIST dataset. The authors report a trade-off between reproducing the network’s weights and performing the auxiliary classification task, and frame the work as a proof of concept—not as an autonomous system that spreads between computers. The paper is available on arXiv.
Further reading
You can understand the basic quine puzzle without buying a book. For readers who want the original theoretical context, von Neumann’s *Theory of Self-reproducing Automata*, edited by Arthur W. Burks and published in 1966, is the relevant volume; its bibliographic record is available through Google Books.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




