An ETA Quine
A quine is a program that prints itself. It's actually a nice challenge to write one in ETA.
Well, here is the first ETA quine. And to prove it works:
$ ./ceta qa.eta >qout.eta $ ls -l q* -rw-r--r-- 1 Administ None 13236 Feb 21 20:29 qa.eta -rw-r--r-- 1 Administ None 13236 Feb 21 21:09 qout.eta $ diff qa.eta qout.eta $
The algorithm is in three parts: First we put values on the stack corresponding to the characters that the second two parts of the program are made of. Secondly, we print all those values in ETA format (n[htaoins]*e - to replicate the first part). Then lastly we output all the values - which prints the rest of the program.
I recommend running it using your favourite ETA interpreter, the faster the better. However, do not use my optimising interpreter because the read phase takes *forever*. This is because the first line is over 11000 chars long - the optimiser does not handle this at all well!
Note that if you download in windows - for example using IE - you may find that carriage returns get inserted at the end of each line. The quine will still work, but because it only prints newlines at the end of each line, the output file size might not match. It should still look the same though.