The TECO Quine
Up:
ShapiroPictures
Many Years Ago I came upon the
quine page, which contained a large collection of incredibly
kh0ul quines written in various languages. On this page was a call for contributions for other obscure languages, one of which was TECO.
TECO started out as an editor on DEC machines but wound up as a turing-complete language. Amusingly enough, some brave soul
ported it to Linux, MS-DOS, and half-a-dozen other OSs.
I actually used TECO in the early '80s to do real programming. It was, and is, a Crawling Horror. In the early '90's, I wrote a TECO quine -- I believe the first in the world. I tried to contact the owner of the quine page, above, but alas we never connected. Eventually I forgot about it.
But now I've reproduced that work and I'd like to keep it here, sort of as a memorial. The ".tec" file is the true quine. The ".tes" file is the quine, documented. One of the Joys of TECO is that, like many early interpreted languages, comments actually slow down programs. In this case, since this is a quine, they also alter the behavior of the program so that it is no longer a quine, although it still runs and produces output.
Run this like any teco program: "mung teco.tec", or ( on crippled Windows implementations ) "tecoc mung teco.tec" . Examine the source with teco with the command "teco quine.tec" or "tecoc teco quine.tec". At the "*" type "ht" followed by two <esc> keypresses to dump the source to the screen. You can exit teco with "ex" followed by two <esc> keys. I'll leave actually editing the source as an Exercise for the Reader.
--
CharlesShapiro - 24 Feb 2007