This is an updated version of a page that I originally posted on my home page at the Department of Computer Science at Queen Mary, University of London in September 1998. It consists of some notes on my early involvement with UNIX development.
[Notes from an interview with Peter Salus, published in A Quarter Century of UNIX, by Peter H. Salus, Addison-Wesley 1994.]
Sunil Das told me he thinks you were in the US in 75 and
gave the em editor to Bill Joy. Has this any basis in fact?
I developed 'em' at QMC in the autumn of 1975, to enable us to exploit more effectively some vdu terminals that we had recently acquired. We had a background of experience in developing applications on graphical displays with both cursor-key and tablet-driven cursor positioning (this experience came to us with William Newman, who spent a year and half working with us between working at Utah and Xerox PARC - see Alan Kay's article in Sigplan notices March 1993 for more on the history of those places and the links between them). I concluded that Unix's 'raw' mode of terminal input, which was at that time almost totally unexploited, could be used to give some of the convenience and immediacy of feedback for text editing that we were used to in our single-user graphical systems, and this led me to develop 'em'.
Then I spent the summer of 1976 as a visitor to the CS Dept. 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. (Although 'em' was designed for vdu's, its single-character interaction could be used - painfully slowly - in TTY's - the current line being re-printed after each interaction!)
One day, sitting at the next terminal was this fairly frenzied hacker/PhD student (Bill Joy) who told me that he was writing a Pascal compiler. I showed him 'em', and he said "that's nice, the system support people might be interested in that". He took me and introduced me to them. They had a couple of PDP11's (I'm not sure which models) 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). I explained that this was achieved by setting the terminal mode to 'raw' so that single characters could be read as they were typed - an eccentric thing for a program to do in 1976.
The system support person (I don't recall his name, but I have a vague recollection that he went to Bell Labs later. Bill Joy might be able to tell you his name) 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 (a process swap on each key depression) 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 - it's ok in our small system, but it's no use in the big Unix environment at Berkeley".
Nevertheless, Bill and the system 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 - of course it still required 'raw' mode, but clearly, the benefits had outweighed the objection.
By the way, 'em' stands for 'editor for mortals' - I christened it that after Ken Thompson visited our lab at QMC while I was developing it and said something like: "yeah, I've seen editors like that, but I don't feel a need for them, I don't want to see the state of the file when I'm editing".
[The above is the bare-bones story of how 'em' led to 'vi'. There is more that I could write about how 'em' was developed and what stimulated me to do it, but I'm not sure whether you need that level of detail].See also: The Wikipedia article on 'vi'.
How did you get UNIX v4 in 73?
William Newman was a Visiting Research Fellow in our Lab for a little over a year from about October 1971 (he then moved to Xerox PARC, and is now at Rank Xerox EuroPARC in Cambridge). We had discovered the value of interactive minicomputer systems with his guidance. He and Mike Cole developed a single-user interactive operating system (called MIFS) at QMC. MIFS ran on an Interdata computer and was loosely modelled on TENEX. It was developed to support two research projects, one by William to investigate the design of a graphical programming language and one by a group of us to investigate the design of a new machine architecture, using microprogrammed emulation. Like Unix, MIFS included a wide range of components and tools - a filing system, a systems programming language, a compiler-compiler, a line editor (with single-character interaction), a debugger, etc. Nearly all of these were developed by William and Mike.
We hadn't heard of Unix while MIFS was under development, but while William was still with us he made a visit to Bell Labs. When he came back he said "they seem to have developed something like MIFS at Murray Hill, but it supports multiple users and runs on PDP11s". Mike Cole obtained some documentation, studied it, and concluded that it could indeed bring us great benefits - it offered most of the facilities that we had found so useful in MIFS and went well beyond it.
QMC was the first UK site to get UNIX. Heriot-Watt was the
second. I see in the first UKUUG newsletter that your configuration
was a PDP11/40 but no RK05s. Did Ken [Thompson] give you 9-track?
No. I don't think we had a 9-track drive, just Dectape and a System Industries 10 Meg exchangeable drive (does your UKUUG newsletter confirm that configuration?) The real problem was that Ken didn't have a driver for the SI controller (and nor did anyone else in the world). Obviously, we couldn't develop a new driver using a Unix system with Dectape as the only peripheral - the swaps would have rendered the process horrendously slow! Mike Cole was our system guru, and he solved the problem. He picked up the v4 release from Ken on Dectape in the Summer of '73, on his way to spend a couple of months visiting Xerox PARC (William Newman was there by that time, and Mike went there to work with him). While at PARC he went to Bezerkeley, wrote and compiled a simple driver for the SI controller and built a kernel that included it. But Bezerkeley didn't have any SI disks, so he couldn't test it there! When he got back to QMC the Dectape was duly mounted, and hey presto! - fortunately Mike was a very good programmer!
A few comments from Mike Cole....
George's account is largely correct but there are a few points that unfortunately diminish my apparently legendary programming skills! My memory is a little hazy in places but I think the following was the sequence of events in the summer of '73.
Since it was so critical that the system worked first time when I got back to QMC I decided to stop over at Bell Labs on my way back to the UK in Oct. Ken Thompson checked over my code, found a bug or two (almost certainly to do with using pointers in C incorrectly) and dumped the entire Unix software onto 7 or 8 Dectapes. Unix then entered the UK for the first time in a PanAm bag!
At 5:21 pm +0100 3/9/98, Eric Fischer
wrote: * I just discovered your web page on the history of the "em" text editor. * There are several things I'm curious to know more about so I hope you * don't mind if I ask you a few questions: * * * You mention that em was an extension of the standard ed text * editor; did it entirely replace the ed line-oriented interface * the way vi does, or was the character-oriented interaction * invoked by a particular ed command? Em was just a compatible upgrade to Ed which allowed visual editing wihin a single line. I used this approach partly because it could be implemented on any vdu (by sending a RETURN character followed by a new version of the line after each alteration) and partly because I didn't really know how to do a full-screen editor! In fact it could even be used on a TTY, although the interaction was painfully slow and the each successive version of the line was printed on a new line. * * * In the version of your account published in A Quarter Century * of Unix, you indicate that em did not use the same keys for * editing commands as for typing text, yet it also ran on ADM-3 * terminals and Teletypes, which have few special keys. Does this * mean that control-key sequences were used for the editing functions, * as in emacs, or was there another mechanism? On ADM-3s and most other contemporary vdus it used control keys. At QMC we modified some VDUs. We had some ITT 3210 vdus that had a block of blue 'arrow keys' on the right of the keyboard. These were only functional when the terminal was in 'full screen mode', when they could be used to move the cursor to a new screen position and overtype the character at that position. This was all local interaction; in 'full screen mode' the contents of the screen were transmitted only when the Send key was pressed. We modified the these terminals to send control codes when the 'arrow keys' were pressed in normal character input mode. This enabled the software to intepret them as editing codes. This enabled me to implement Em in a more usable manner. It also led to the development of 'ded', a full screen editor that was modeless, by my colleague Richard Bornat. Subsequently, we obtained a larger number of Hazeltine 1510 terminals. These were microprocessor controlled and we re-programmed them to provide a larger set of dedicated cursor control and character editing keys (move forward a word, move backward a word, delete character backward, delete character forward, delete word backward, delete word forward, etc.) This provided another huge step forward in usability and allowed us to maintain our modeless approach to screen editing, which was, we feel, superior to the Vi approach. * * * Do you remember any of the commands that em used, or still have * copies of any of the documentation or source code?
Source code for 'em' (including Ken Thompson's original code for 'ed') and accompanying documentation files.
Hardcopy of the "em" manual page.
Pierre Gaston has very kindly produced an updated version of the original em code that is compatible with modern UNIX systems. I'm extremely grateful to Pierre for this work, which involved many updates to reflect changes in the C language and libraries and in UNIX system calls since 1976. Nertheless, it's a tribute to the designers of C and UNIX that modern versions of the language and system remain sufficiently similar to the early versions that a program written in 1976 could be ported without a more major re-write.