What Links Here?
Outbound Links
Quine Programming Language
Quine (the Quine Programming Language) is a programming language for writing quines, or rather, one specific quine.
Quine (at Github) is based on a virtual machine that contains a buffer holding the previous token, a main queue which can hold arbitrary tokens, and a standard output stream. The VM is manipulated by these machine language statements:
000- (e) - raiseerror: dump the contents of themain queuetostandard output, followed by 'e' to indicate that an error has occurred.001- (i) - disable copying of the previous token to themain queue(andindicate success) by writing current token to themain queue.010- (n) - copy previous and current token to themain queue.011- (q) - clear the mainqueue and commence normal operation.100- (u) -undertake continuous copying of the previous tokenbufferto themain queue.
There are no other symbols or operators permitted.
White space is significant: there must be none.
The nature of the parser, tokenizer, and the virtual machine architecture mean that for complex reasons it is a syntax error to place the high level tokens in any order other than:
qfollowed byufollowed byifollowed bynfollowed byeand nothing after this.
The consequence of this is that the only valid program in the language Quine is this:
quine
When executed it provides this output:
quine
"Quine" is perfect at producing quines. And "quine" is a perfect quine. Sure, you can write shorter quines, but can you really write * better * quines?
Quine's quine ("quine") is the perfect quine.
Though there's one quine that might be better -- that is the quine that has no code, and produces no output. The Empty Quine.
The Sound of No Quines Running
A quine that doesn't exist produces no output -- the result of which, when executed, produces no output.
One of the oldest and deepest questions in Quineology is the question of whether an empty quine can be a quine? And if not, then how can we speak of an empty quine?
See also at this current wiki
- Unbounded recursion
- How to become a programmer
- Esoteric Programming Concepts
- Quine - a page about writing a Quine in C#, to demonstrate the thought process behind constructing a Quine.