TECO (text editor)
Original author(s) | Dan Murphy |
---|---|
Initial release | 1962/63 |
Operating system | OS/8, ITS, TOPS-10, TOPS-20, RT-11, RSTS/E, RSX-11, OpenVMS, Multics |
Type | Text editor |
TECO (
According to Murphy, the initial acronym was Tape Editor and Corrector because "
Description
TECO is not only an editor but also an
TECO does not really have syntax; each character in a program is an imperative command, dispatched to its corresponding routine. That routine may read further characters from the program stream (giving the effect of string arguments), change the position of the "program counter" (giving the effect of control structures), or push values onto a value stack (giving the effect of nested parentheses). But there is nothing to prevent operations like jumping into the middle of a comment, since there is no syntax and no parsing.
TECO ignores
A satirical essay on computer programming, Real Programmers Don't Use Pascal, suggested that a common game for TECO fans was to enter their name as a command sequence, and then try to work out what would happen. The same essay in describing TECO coined the acronym YAFIYGI, meaning "You Asked For It You Got It" (in contrast to WYSIWYG).
Impact
The
TECO was available for several operating systems and computers, including the
TECO continues to be included in OpenVMS by VSI, and is invoked with the EDIT/TECO
command.[14]
A descendant of the version DEC distributed for the PDP-10 is still available on the Internet, along with several partial implementations for the MS-DOS/Microsoft Windows environment.
History
TECO was originally developed at MIT
An early editor for the PDP-1 was named "
The original stated purpose of TECO was to make more efficient use of the PDP-1. As envisioned in the manual, rather than performing editing "expensively" by sitting at a console, one would simply examine the faulty text and prepare a "correction tape" describing the editing operations to be performed on the text. One would efficiently feed the source tape and the correction tape into the PDP-1 via its high-speed (200 characters per second) reader. Running TECO, it immediately would punch an edited tape with its high-speed (60 characters per second) punch. One could then immediately proceed to load and run the assembler, with no time wasted in online editing.
TECO's sophisticated searching operations were motivated by the fact that the offline Flexowriter printouts were not line-numbered. Editing locations therefore needed to be specified by context rather than by line number. The various looping and conditional constructs (which made TECO
The correction tape was a program, and required debugging just like any other program. The pitfalls of even the simplest global search-and-replace soon became evident. In practice, TECO editing was performed online just as it had been with Expensive Typewriter (although TECO was certainly a more feature-complete editor than Expensive Typewriter, so editing was much more efficient with TECO). The original PDP-1 version had no screen display. The only way to observe the state of the text during the editing process was to type in commands that would cause the text (or portions thereof) to be typed out on the console typewriter.
By 1964, a special Version of TECO (TECO-6) had been implemented on the
At MIT, TECO development continued in the fall of 1971.[citation needed] Carl Mikkelsen had implemented a real-time edit mode loosely based on the TECO-6 graphic console commands, but working with the newly installed Datapoint-3300 CRT text displays.[19] The TECO buffer implementation, however, was terribly inefficient for processing single character insert or delete functions—editing consumed 100% of the PDP-10. With Richard Greenblatt's support, in summer of 1972 Carl reimplemented the TECO buffer storage and reformed the macros as native PDP-10 code. [citation needed] As entering the real-time mode was by typing cntl+R, this was known as control-R mode. At the same time, Rici Liknaitski added input-time macros (cntl+]), which operated as the command string was read rather than when executed.[citation needed] Read-time macros made the TECO auxiliary text buffers, called Q-registers, more useful.[citation needed] Carl expanded the Q-register name space. With read-time macros, a large Q-register name space, and efficient buffer operations, the stage was set for binding each key to a macro.[20] These edit macros evolved into Emacs.[21]
The VMS implementation has a long history - it began as TECO-8, implemented in PDP-8 assembly. This code was translated into PDP-11 assembly to produce TECO-11. TECO-11 was used in early versions of VAX/VMS in PDP-11 compatibility mode. It was later translated from PDP-11 assembly into VAX assembly to produce TECO32. TECO32 was then converted with the VEST and AEST binary translation utilities to make it compatible with OpenVMS on the Alpha and Itanium respectively.[22][23][24]
OS/8 MUNG command
The OS/8 CCL MUNG command invoked TECO to read and execute the specified .TE TECO macro. Optional command line parameters gave added adaptability.[25]
As a programmer's tool
During and shortly following the years of the punched card era, there were source programs that had begun as punched card-based. Comments were often a series of lines that included single marginal asterisks and top/bottom full lines of asterisks. Once the cards were transferred online, it was a chore to realign the marginal stars. TECO to the rescue...[26][27]
As a programming language
The obscurity of the TECO programming language is described in the following quote from "Real Programmers Don't Use Pascal", a letter from Ed Post to Datamation, July 1983:
It has been observed that a TECO command sequence more closely resembles transmission line noise than readable text. One of the more entertaining games to play with TECO is to type your name in as a command line and try to guess what it does. Just about any possible typing error while talking with TECO will probably destroy your program, or even worse - introduce subtle and mysterious bugs in a once working subroutine.[28]
According to Craig Finseth, author of The Craft of Text Editing,[29] TECO has been described as a "write-only" language, implying that once a program is written in TECO, it is extremely difficult to comprehend what it did without appropriate documentation.
Despite its syntax, the TECO command language was tremendously powerful, and clones are still available for MS-DOS and for Unix.
TECO commands are characters (including control-characters), and the prompt is a single asterisk:
*
The escape key displays as a dollar sign, pressed once it delineates the end of a command requiring an argument and pressed twice initiates the execution of the entered commands:
*$$
Example code
Given a file named hello.c with the following contents:
int main(int argc, char **argv)
{
printf("Hello world!\n");
return 0;
}
one could use the following TECO session (noting that the prompt is "*" and "$" is how ESC is echoed) to change "Hello" into "Goodbye":
*EBhello.c$$ Open file for read/write with backup
*P$$ Read in the first page
*SHello$0TT$$ Search for "Hello" and print the line (pointer placed after searched string)
printf("Hello world!\n"); The line
*-5DIGoodbye$0TT$$ Delete five characters before pointer (ie "Hello"), insert "Goodbye", and print the line
printf("Goodbye world!\n"); The updated line
*EX$$ Copy the remainder of the file and exit
These two example programs are a simple interchange sort of the current text buffer, based on the 1st character of each line, taken from the PDP-11 TECO User's Guide.
Example 1
!START! j 0aua ! jump to beginning, load 1st char in register A ! !CONT! l 0aub ! load first char of next line in register B ! qa-qb"g xa k -l ga 1uz ' ! if A>B, switch lines and set flag in register Z ! qbua ! load B into A ! l z-."g -l @o/CONT/ ' ! loop back if another line in buffer ! qz"g 0uz @o/START/ ' ! repeat if a switch was made on last pass !
Example 2
<0uz ! clear repeat flag ! j 0aua l ! load 1st char into register A ! <0aub ! load 1st char of next line into B ! qa-qb"g xa k -l ga -1uz ' ! if A>B, switch lines and set flag ! qbua ! load B into A ! l .-z;> ! loop back if another line in buffer ! qz;> ! repeat if a switch was made last pass !
Notes
- ^ "DEC Timesharing". The DEC Professional.
Tee'koh
- ISBN 978-1483221106.
- ^ The name on the cover of DEC's DEC-10-UTECA-A-D manual is "Introduction To TECO (Text Editor And Corrector)"
- ^ a b PDP 8/e small computer handbook. 1970. pp. 2–30.
- ^ S2CID 18805607.
- ^ citing Comm. of the ACM (see vol. 19, no. 12, 1976)
- ^ "TECO". The Jargon File. v.4.4.7. ibiblio.
- ^ "A History of EMACS".
- ISBN 022617249X.
EMACS was originally built on top of TECO
- ISBN 978-1484217030.
- ^ "TECO Pocket Guide".
<tab>text$, Inserts specified text preceded by a tab.
- ^ a b "Standard TECO Text Editor and Corrector".
Standard TECO. Text Editor and Corrector for the. VAX, PDP-11, PDP-10, and. PDP-8.
- ^ "Doug Jones's DEC PDP-8 FAQs".
What programming languages were supported on the PDP-8? ... TECO, the text editor, was included in the standard OS/8 distributions
- ^ "VSI OpenVMS DCL Dictionary: A-Z" (PDF). vmssoftware.com. April 2020. Retrieved 2020-09-13.
- ^ "Summary of TECO commands". From a collection of MIT PDP-1 paper tapes at the Computer History Museum. Archived from the original on 2008-01-18. Retrieved 2007-09-12.
- ^
Murphy, Dan (2009). "The Beginnings of TECO" (PDF). S2CID 18805607.
- ^
Samson, Peter (July 23, 1965). "PDP-6 TECO". Memorandum MAC-M-250. p. 9. hdl:1721.1/5917. Retrieved 2007-09-12.
- ^ Edwards, Daniel J. (October 29, 1964). "TECO 6". Memorandum MAC-M-191. p. 2. Archived from the original on 2007-09-28. Retrieved 2007-09-12.
- ^
"For the Time Sharing Computer User: Datapoint 3300" (PDF). Computer Terminal Corporation. Retrieved 2009-10-27.
- ^
"Teco Editor". c2.com. August 16, 2010. Retrieved 2013-08-17.
- ^ "An Introduction to the EMACS Editor" (PDF). MIT. January 1978. Archived from the original (PDF) on 2020-10-27. Retrieved 2016-11-15.
- ^ "tecox Readme". github.com. 2019-06-10. Retrieved 2020-09-13.
- ^ "VAX PDP11 Compatibility Mode". comp.os.vms.narkive.com. 2019-08-06. Retrieved 2020-09-13.
- ^ "Andy Goldstein retirement". comp.os.vms.narkive.com. 2009-06-12. Retrieved 2020-09-13.
- ^ "TECO Reference Manual digital equipment corporation" (PDF).
- ^ Martin Pring (July 1982), Why Teco
- ^ He wrote this years after his colleague Carl B. Marbach became editor of a DEC-oriented periodical and wrote "Why Teco?". Both items were published together.
- ^ Post, Ed (July 1983). "Real Programmers Don't Use PASCAL". Datamation. 29 (7): 263–265.
- ^
Finseth, Craig A. (2006). The Craft of Text Editing. ISBN 978-1-4116-8297-9.
References
- TECO pocket guide. Digital Equipment Corporation. 1978. Archived from the original on 2008-02-07. Retrieved 2012-05-24.
- Murphy, Dan (2009). "The Beginnings of TECO" (PDF). S2CID 18805607.
- TECO Historic Archive. 1990.
External links
- Dan Murphy's personal site
- Pete Siemsen's TECO collection
- Tom Almy's TECO page. Includes a TECO based on Pete Siemsen's TECOC and DECUS documentation. There are MS-DOS, Windows (console), Linux, Mac OS X, and OS/2 versions.
- Introduction to the TECO syntax
- TECO Information
This article is based in part on the Jargon File, which is in the public domain.