Things Have History

code-editors

TECO, or the editor that was also a programming language

Listen

In Building 26 at MIT, sometime in 1962, a sophomore named Daniel Murphy looked at a strip of punched paper tape and decided this was no way to write software. The Friden Flexowriter — a glorified typewriter that simultaneously printed text and punched holes in a continuous ribbon — was the standard way to prepare source code for the PDP-1 computers his department shared. Correct a typo, and you didn’t backspace: you walked to the Flexowriter, re-punched the offending section, spliced the corrected strip back into the tape by hand, and hoped the mechanical reader agreed with your splicing.

Murphy’s answer was a program he called the Tape Editor and Corrector, or TECO. It ran on the PDP-1, talked to the machine through a console typewriter, and let you search, insert, delete, and rearrange characters in the tape’s contents without touching the physical ribbon. Wikipedia As disk storage eventually replaced tape, the name shifted to Text Editor and Corrector, but the acronym stubbornly outlived the medium it was named after.

What made TECO unusual — and eventually powerful — was that its command language was also a full programming language. Type S to search, I to insert, D to delete; add angle brackets for loops, conditional branches for logic. By 1964, TECO was Turing-complete, and that same year a PDP-6 implementation at MIT’s Project MAC added something more startling: a real-time CRT display that updated visible text with every keystroke, years before that combination had a common name.

The command language, however, developed a certain reputation. A satirical essay circulating among the hackers at the AI Lab noted that a TECO command sequence “more closely resembles transmission line noise than readable text.” This was not entirely a criticism. Regulars at MIT played a game: type your name as a TECO command string and observe what the interpreter did to the buffer. The results were, by all accounts, varied and instructive.

In 1972, Carl Mikkelsen, a hacker at the AI Lab, wired a display/editing mode into TECO — Control-R — that refreshed the screen after every character. Richard Stallman saw it, rewrote it to run efficiently, then layered a macro system on top that let users redefine any keystroke to invoke any TECO program. By 1976, that macro layer had expanded into EMACS — the name standing for Editor MACroS — a full editing environment that ran inside TECO while no longer really being TECO. GNU Project Murphy, meanwhile, had graduated in 1965, joined Bolt Beranek and Newman, and there helped Ray Tomlinson assemble the world’s first email system — suggesting that text manipulation was only ever one item on his list. Wikipedia

TECO’s lasting contribution wasn’t any particular command. It was the premise that a text editor and a programming language are the same thing — that the act of editing text and the act of computing are not different activities but one activity applied to the same material. Every editor that followed, from vi to Emacs to the extension APIs of today, is still working out the implications of that idea, first pressed into a paper tape in Building 26.

Sources