Chapter 4. A Tale of Two Editors

In Chapter 1, I mentioned CTSS and ITS. At that time, early in the 1960s, TECO (Tape Editor and COrrector; later, Text Editor ...) was the editor everyone used on the PDP-1 and, later, on the PDP-6. Not only was it widely used, but just about everyone modified it. (In RFC 681, quoted earlier, an editor "based on QED" is mentioned. QED was written by Butler Lampson, who wrote the QED text editor for the Berkeley Time-Sharing System on the SDS 940. It was character-oriented and based on TECO. Ken Thompson used this version of QED while a student at Berkeley, prior to going to Bell Labs in 1966.) Indirectly, TECO was the ancestor of vi; directly, it was the parent of Emacs (= Editing macros for TECO).

Interestingly, Bill Joy created vi in 1976 and Richard Stallman (together with Guy Steele and Dave Moon) created Emacs the same year. The original version was based on TECMAC and TMACS, two TECO editors. Stallman and Michael McMahon ported it to the Tenex [for the DEC-10] and TOPS-20 [for the DEC-20] operating systems. [James Gosling, the creator of Oak/Java, wrote the first Emacs for UNIX at Carnegie-Mellon in 1981. RMS began work on GNU EMACS in 1984.]

Joy's creation had a more complex origin.

The editor created by Ken Thompson in August 1969 was called ed. Ken had written a version of QED for CTSS on the IBM 7094 at MIT. He and Ritchie then wrote a version for the GE-635 at Bell Labs. The cut-down version of this for the PDP-7 was ed. While TECO was known for its complex syntax, ed must have been the most user-hostile editor ever created.

Across the Atlantic in London, George Coulouris at Queen Mary College (now Queen Mary and Wakefield College) had gotten UNIX v4 in late 1973. George explained to me how unhappy he had been with ed and how he created em (editor for mortals) so that QMC students could "exploit more effectively some vdu [visual display unit] that we had recently acquired..."

Then I spent the summer of 1976 as a visitor to the CS Department at Berkeley. I worked in a room full of teletype terminals using the departmental UNIX. I had brought em with me on DECtape and installed it there for my own use...
One day, sitting at the next terminal was this fairly frenzied hacker/Ph.D. Student [Bill Joy] who told me he was writing a Pascal compiler. I showed him em, and he said "that's nice, the systems support people might be interested in that." He took me and introduced me to them. They had a couple of PDP-11s ... supporting several rooms full of vdu terminals connected at 9600 baud, an environment in which em could really shine.
I explained that em was an extension of ed that gave key-stroke level interaction for editing within a single line, displaying the up-to-date line on the screen (a sort of single-line screen editor)...
The system support person [Jeff Schriebman] said something like: "That's very nice, but if we made it available to all of our users the overheads associated with running in raw mode would swamp the cpu."
I was rather depressed by this reaction, thinking "I guess I have been unrealistic in developing an editor that is so expensive to run..."
Nevertheless, Bill and the support people took a copy of my source to see if they would use it. I then went to the East Coast for a week or so. When I returned, I found that Bill had taken my code as a starting point and had got a long way towards what was to become ex and subsequently vi, and that the editor was installed on the service machines ...

1976! Created in 1969, ed had travelled east to Australia and west to Vienna. Coulouris had created em in London and brought it to Berkeley. Now the Berkeley editor, ex, would be available on the first UCB tape. But vi, which was available on 2BSD (1979), only made it into a BTL distribution with v8 (1985).

Even in 1976, international communication and access to source meant the distribution of new tools and new programs encouraged and enlivened the user community. Let's look at the landscape for a few minutes.

  1. In 1974, Bob Kahn and Vint Cerf published the first paper describing what was to become TCP/IP.

  2. In 1975, RFC 681 was published.

  3. In January 1976, there were 63 hosts on the ARPAnet, which was on the verge of becoming the Internet.

  4. And UNIX was available throughout the world -- but only on hardware that cost well over $10,000.