Quine is a programming language for writing quines, or rather, one specific quine.
Quine 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
) - raisee
rror: dump the contents of themain queue
tostandard output
, followed by 'e' to indicate that an error has occurred.001
- (i
) - disable copying of the previous token to themain queue
(andi
ndicate success) by writing current token to themain queue
.010
- (n
) - copy previous an
d current token to themain queue
.011
- (q
) - clear the mainq
ueue and commence normal operation.100
- (u
) -u
ndertake continuous copying of the previous tokenbuffer
to 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:
q
u
i
n
e
The consequence of this is that the only valid program in the language Quine is this:
quine
When executed it provides this output:
quine