You are here: Foswiki>ALE Web>ScaryTechnicalStuffOnWheels>TecoQuine (17 December 2009, willyonwheels)Edit Attach

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
I Attachment Action Size Date Who CommentSorted ascending
Quine.testes Quine.tes manage 1 K 24 February 2007 CharlesShapiro The Documented Almost Quine
Quine.tectec Quine.tec manage 76 bytes 24 February 2007 CharlesShapiro The Teco Quine
Topic revision: r3 - 17 December 2009, willyonwheels
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback