ࡱ> (+0.)G Jbjbjَ ) ]8:   $   T T T T .  T ,T  $`am.& Interview with Ken Thompson, 9-6-89 MSM: Is it six? Is it six? Pass says seven. Okay, I ll be here tomorrow. Okay. I was going by the pass. Thompson: Various accounts Ive read of UNIX [such as] Ritchies retrospective on it and even in an interview you did with some people, for a video back in1981 talk about the system as being or UNIX as being sort of calling all the best ideas in operating systems that emerged during the 60s. What were those ideas and how did you first encounter them, how did you encounter them as ideas? Thompson: My background for obtaining these ideas was uh, there was a I went to the school at Berkeley and there was a thing called Project Genie at Berkeley. As project Genie it was never very heavily advertised. But, what they is brought a SDS930 through an ARPA grant and cannibalized it, put paging in it and it became what SDS later marketed as SDS940,which was a time sharing system. In it there were some Mel Butler, Lampson, Peter Deutsche and Mel Hurdle were there. They were the chief people there, who went on to do other things. But, they essentially made a cleaned up version of MITs operating system. Time sharing system. MSM: The CTSS? Thompson: Actually, no PB1060. (not clear) Its a TDA. Its a three-letter acronym. IDN or ISN or I something. I cant remember. Anyway they had a lot of fun ideas in there and there and a nice clean file system. Then when I went to Bell Laboratories, I worked on CTSS, I used CTSS per say. I used CTSS and did some, a lot of programming on CTSS and I worked on MULTICS. MSM: What did you promote? Thompson: We were involved with the file system, which never really came to exist, because um the addressing is built into the paging system. -- the whole process is seen by paging -- and what we did was try to develop read and write calls that were sequential calls that turned around and ended just reading sequentially out of pages, its sort of upside down notion. And the um there were problems with the segments, things called files, and that they were fairly short and maximum size. Through the eighteen words of addressing, max. So, if you want big files you had to concatenate segments and walk across to the two-dimensional address --one dimension being the segment number and the other dimension being the word within the segment. Anyway, it was to try to clean up some of those problems with paging. But, it... so anyway... Thats were most of the ideas came from was the combination of those three systems. The 940 system... what became the 940 system. CTSS and Multics, you know a couple of new ideas. MSM: Which ones were they? Thompson: Um Pipes. There were a lot of things that were talked about but werent really done. Like treating files and devices the same, you know having the same read calls. Typically during those days there were special calls for the terminal and then the file system itself. Those calls werent the same. Confusing them and redirecting IO was just not done in those days. So, that was... I think everyone sort of viewed that as a clean concept and the right thing to do but for some reason it just wasnt done. It was just the right time to actually install the feedback; and, uh, the things we stole: We stole a shell out of a MULTICS, the concept of a shell. We stole per process execution. You know create a process -execute the command. From a combination of the two, although, neither of them really did it, MULTICS wanted to do it. But, it was so expensive creating a process that it ended up creating a few processes and then using them and putting them back on the shelf, then picking them up and reinitializing them. So, they never really created a process for command because it was just too expensive. The ION direction and the stuff like that and later in fact streams came from um the IO switch, that we worked on in MULTICS. Having everything work the same and just directing, you know, changing what it really pointed to. Hard to think. I remember at the time that there was a discussion on whether we should go to six or eight bytes. Seems like silly discussion now. Wasting all that space, you know, going to eight bit bytes when there was only six bits of information there. (Laughing) It doesnt seem like a grave decision, but it really was. In higher level language which was still (not clear), we had always wanted to do that. The original wasnt, was written in a simple language. But, MSM: Go you wanted to go to high level from the star t? Thompson: Right from the start. Knew we had to. MSM: Was that MULTICS influence? Thompson: That was MULTICS influence. And just the complexity of maintaining the thing, we just knew that, you cant maintain something. Even write it, get it going. But, it will evolve. MSM: Did the choice seem obvious to you? As to which high-level language to use? Thompson: No. Not at all. Because none was really good. PL/1 was too high for us. Which was what MULTICS did. Or even the simpler versions of PL/1that we used in MULTICS. Like there was a thing called EPL. The 360 was around, although it was IBM-proprietary. After UNIX was up, or, simultaneous with UNIX coming out, BCPL was just emerging and that was a clear winner with both of us. Both of us were really taken by the language and did a lot of work with it. MSM: How did you come up with it, its an English language wasnt it? Thompson: Ah yes, but the guy who did, Martin Richards, actually developed it at MIT. It was available in a very informal way, on CTSS and we pulled it off of CTSS and got a version running on GECOS here and did system programming there. It was too big a language to run on the UNIX machines that were 4K machines. Thats when B was developed. Which was ... MSM: Did you develop B? Thompson: I did B. MSM: As a subset of BCPL Thompson: It wasnt a subset. It was almost exactly the same. It was a interpreter instead of a compiler. It had two passes. One went into intermediate language and which one was the interpreter of the intermediate language. Dennis wrote a compiler for B, that worked out of the intermediate language. It was very portable and in less than a day you could get very versatile (not clear). Typically the interpreter was a set macros for your interpreter, they were very field orientated and you just define these macros with these fields and then write a little interpreter that would switch the set routines, and you had to write about twenty three-line routines, and it would run. And it was very small, very clean. It was the same language as BCPL, it looked completely different, syntactically it was, you know, a redo. The semantics was exactly the same as BCPL. And in fact the syntax of it was, if you looked at, you didnt look too close, you would say it was C. Because in fact it was C, without types. Theres no word like interchar or struct or anything like that. The word for... There was a word for extern, which means to declare an external thing. There was a word auto, which declared an auto thing. So, it would be like auto XYZ, instead int XYZ and it meant word. Which was the only time. MSM: So it operated really at the machine level. Thompson: Yeah. It was used to a very small extent. It was written in its own language. Thats why its so portable. Because you just pull it through and its up real quickly. Um... But, the interpreters, the interpreter for the 11 was having some trouble. It wasnt a word machine, and this thing had a word notion, and so on almost every operator you had shift left and shift right, shift left and shift right. It was just not a good match at all and part of this is we didnt have a good -on top of the interpreter problem-, it wasnt even a good interpreter on the 11, because of the mismatch of the machine and that we wanted something better as the systems language is what prompted Dennis to slowly permute it into C. MSM: So C essentially contains B? Thompson: Well, some of the anachronisms of C, that are now gone, or, at least are not or are unpublished to the point that no one knows theyre there, are B anachronisms. Like auto. Theres a word called auto. No one knows, I think its actually ANSI finally. The word oriented parts of C, as C emerged were in fact the basic routines. And in fact one of the major, at least in my view (not clear) with C is that a arrays to are promoted to the address of the base of the array every time you touch them and thats one of the fundamental things of the NBCPL. That theres no such thing as an array but theres these things called vectors. A vector is a list of words and declaration of a vector is a word containing a pointer to a list of words. If you say auto x of 5, theres no such thing as x of five, you know, thats a type, and there is no types in this language. So, what it is, its a single word called x and then five words that are unnamed and a pointer, initialization of a pointer into x to the base of the five words. To keep that semantics and develop a notion of an array, which we want to promote. The name of an array into the address to do it at run time. Anyway, MSM: It always seems to be one of the neat features. The way you could step through an array with arithmetic. Thompson: Oh yeah, yeah. MSM: You prompted a question when you talked about portability of B and of course one makes a great deal of the portability of UNIX itself and its a portability, if I understand you correctly, based on self-reference, or almost self-modification, which was the theme you were pursuing in your Turing Award talk, largely to suggest the dangers of doing it. Is that a theme of continuing interest to you? Thompson: Have I got it right to start with? I guess its wrapped up. Von Neumann machines in the real sense. Theres a lot of power in executing data --generating data and executing data. In fact, thats how languages work and in college I worked for the comp center and it was thrown upon me to maintain a language called NELIAC and its no longer wanted. Then later on then another language called Smalgol as a subset of Algol. Which were compilers both written in their own language. You get a sense of, I dont know, bootstrapping and of self-modifying programs and of self-replicated programs when you are in a position of maintaining a language written in its own language. Even if its written in a simple language, you know, you get this feeling of bootstrapping and moving on and I used to do a lot of that stuff, earlier. In fact, the Turing talk was about work I did a long, long time ago. Im really sure I referenced the date that it was done in the talk. MSM: You talked about the game of writing the shortest program that writes itself. You said, I imagine people programmed in Fortran for the same reason they took three-legged races. Thompson: (Laughing) I shouldnt say such things. MSM: Well, all right. Its a great remark. Thompson: Last year I taught at University of Sydney I gave that to my class, the shortest self-reproducing program in C, and I got a surprise. I didnt think there was a surprise there to be had. But, I got somebody who has the shortest one Ive ever seen, which is a record breaker, by about four characters of what I had proved to myself was the shortest program, and they did it by a totally different mechanism which of course nullified the proof. MSM: Did you spend any time up at MIT during MULTICS ? Did you come... Thompson: I just went in and out for a day at a time. Maybe for ten times. Something like that. Yeah. Id go up there for... just ran through the halls and did work and go to meetings and stuff like that. I spent no time, I didnt teach and I didnt stay there for more than a day at a time . MSM: Cause some of these things were very much a part of that environment: Minsky and then LISP, which essentially is a language written in itself. Thompson: Well, LISP , least the original LISP, you know, the book, 1.5 is... you know I think its a horrible language. I really do. But, I was struck with that book and the idea of defining very, very low level semantics, you know cons and (not clear). Essentially thats all thats defined, maybe a few more. From that, developing a... its not so much written in itself that it defines its own interpreter, in a way that gets into the what I think is the whole semantics for (hearing?) languages. Its always been a problem when you write a language or describe a language to say what constructs it recognizes and what they mean and what they actually do and that was the cleanest, simplest, most recursive, beautiful semantics of a language Ive ever seen. Probably even to this day. But, unfortunately, what it describes I think is just a horrible language. I agree. Thats really striking, 1.5. I did a lot of that. I did a lot of compiling. Even in college and out of college I did a lot of on-the-fly compilers. Ah. ah. I wrote a GREP-like program. It would... You type in , youd say what you wanted it to look for, and a sed-like thing also. That youd say, I want to do a substitute of A for B or some block of text. What it would do is compile a program that would look for A and substitute in B and then run the compiled program so that one level removed from it do I direct my (unclear) and the early languages, the regular expression searching stuff in ED and its predecessors on CTSS and those things were in fact compilers for searches. They in fact compiled regular... MSM: Does this reflect itself in UNIX as it was developed? Thompson: Not a whole lot. Outside of operating systems in general tend to operate on programs and they have to somehow turn the notion of data and programs inside out. Theyre operating on what they think are data, and that data are running programs. The whole (unclear) is encapsulating processes as not variables just data comes into it. But, no its nothing real fancy in terms of.... Do you know this kid Henry Heslin (?) Hes a PHD student at Columbia. Hes the doing a lot of weird stuff very similar to this now. He has a UNIX mailbox that does 68,000. But, when he issues a open on a file. Its the same semantics as UNIX. He compiles into what would be the open file table. Build the subroutines to getchar, putchar, read and rrite and getchar, putchar, that are just amazingly fast with all the checking built in. You know the files open, you know the descriptors here. You know all of this so that.... A read call traps right into this pre-compiled code for that at one character per time in a system that he gets faster than most systems get and are doing 8K at a time. He does a lot of that stuff. MSM: I see. Does he work from here? Thompson: No, no. Hes... MSM: How do you know about him? Thompson: Um ... he wrote a paper that some people hate and some people love. I was struck by it. Its called Super Optimizer. What he does, he defines a function he wants to write, and see, and then he by trial and error, he builds that machine language that will implement the function, he uses the function to check the machine language. So, hell try essentially all programs and then see if that program equals that program, but semantically. MSM: (Laughing) I like to see what Im getting... . Its a difference of opinion.(Laughing) Thompson: And um, it generates shortest possible program for small functions, you cant do big things. It generates code that is absolutely inhuman. Its, its indescribable, to be honest. Um, and um code you,... its easy...theres no way to describe it except that it proves it. Ive use that idea, since I read that paper, Ive used that idea around four or five times. On one case I used it for a compiler Im writing for 68000 um, multiply takes thirty-two seconds no matter what. So, if you multiply something by three, thirty-two cycles. Those same thirty-two cycles, thirty-two adds, on this machine. So, what a combination if you change a multiply into shifts and adds. Multiply by a constant with shifts and adds of, you know, the original thing. Youre going to always beat the multiply because, the multiply is implemented so badly on this chip and so what I did is write super optimizer, which tries all combinations of shifts and adds to generate, to simulate a multiply by constants between one and ten thousand or something like that, and put them into tables and take the C the compiler and generate explicit code which is the best shift and adds and subtract. MSM: So the multiply go to the table, look up at.... Thompson: No, no it doesnt go to the table, the compiler goes to the table. You say multiply by five and the compiler goes to the table and does shift left of four and add. Its four plus one. MSM: So it picks up a particular combination of shifts and adds that will work for that particular multiplication. Thompson: Right, shifts, adds, and multiplies. MSM: By doing table lookup and then imbedding code. Thompson: Right. And its optimal because thats how the table was generated, by trial and error, all shifts and adds that can generate all multiplies of all things. Another one, is that the bit blit on this thing is um... its read a pixel, a block of pixels, perform some operation on a block of pixels. Its like plus equals. You know, pixel block plus equals pixel block. Where a plus is a pixel is an XOR an man / you know all these operators. So, you put in any of the arbitrary binary sixteen, any of the sixteen binary operators in this opcode for the bit blit. And the whole things compiled. When you do a bit blit you compile the code and run it, and you want the best compiled code for these operations. You had to find the best compiled code for these operations. Put it into tables that are up and generated by trying all of the programs. MSM: What machines? Thompson: 68020. MSM: Is that the NeXT symbol of the NeXT machine? Or is that just the (unclear)right there? Thompson: No its just a joke. Thompson: Thats the machine sitting on the table. Its a terminal in.... Its...tactically, if you want to use the word, its almost a Sun3. Its the 68020 floating point, four-meg memory. Network interface which is an ether - its a (unclear) MSM: Did you design that yourself? Thompson: No, no. It was designed here. Not by me. MSM: Let me pull you back. ...Talked about this distillation of all the good ideas. Were there ideas that you particularly wanted to avoid, or features you wanted to avoid, or that you had in mind as representative of what was bad with operating systems? Thompson: Yeah. There were lots of them. I wanted to avoid, special IO for terminals. I wanted to have virtual memory, at least as its coupled with file systems. I wanted to keep file systems really exclusive and separate from virtual memory -as not be read and be write. There were lots of things. Ah. I wanted to avoid this thing called an executive. The word has lost its meaning now. What it was is a pseudo-shell, built into the kernel, that somehow controlled the console and execute the commands for you and to drag that out and make it a process of any process could execute any command. MSM: Just to make sure that every processor...it sets every processor the same as a user processor and having this privileged. Thompson: Yeah and also to make the thing that became known as the shell its handled in like any other program. There was no the shell that came with the system that you were stuck with for life. In fact, we started off with two or three different shells and the shell had life of its own. A new shell would come in and supplant the old one and there were... shells performed different functions. Like, there was a shell for a video interface. A shell for a voice synthesizer. You know, what you would do is bring in a touch tone phone and put another shell in its place. So, anyway, the idea that there was no built in known level of command, that, that was just a replacement program that we could avoid like any other. We tried to avoid, you know, records. We were told over and over that was probably the most serious mistake and the reason was the system would never catch on, because we didnt have records. Essentially, the record manager was images imbedded in disk images. Having just this uniform sequence of lights, they said over and over to us that was a serious mistake, but we stuck by it. MSM: Ive just been having exchange systems programmer down at Princeton on the IBM mainframe. The problem, default record formats and what happens when you try and do a get on a file thats got a different format, losing (unclear) records when...do you have a code? Thompson: I have um. I have um...in that era, we werent trying to promote this idea. Id give talks, we always come up, you know, why you didnt do records and Id have some extra slides, cause I knew Id be asked this. You know, you know, you jumped and said, Well, I just happen to have a couple of these laying around. (Laughing) There, the best slide and best story is McIlroys test. You ever heard of it? MSM: Sort of finding a.... Thompson: Yeah its a Fortran program that works .... MSM: ... the first e in the in the eighth column, and you do it on the Fortran program itself. Thompson: Right. To ask them to go through the steps is just priceless-- to see what happens in these systems when you do that. It all has to do with record formats. Confusing program and data, in a file format. You know, that things... You know, theres text files that are data formatted. You know, on and on and on. (not clear) Its just.... That was one of the things. The other thing is that, theres a series of thunderbolts out of manuals. Describing um. (not clear) By chance (Shuffling of papers) Thompson: I think this might be it...No, this isnt it... .This is very similar. Thompson: You know about the Yeah. Its putting it there . In our UNIX paper. Um, um. Dennis wrote this. It offers a number of features (not clear) it was actually a joke. It means nothing in a sense. Its those kind of things that people write in papers. People picked it up. Some people picked it as a joke, and some people didnt really understand it as a joke.(Laughing) Variations. Variations on that and thats how it gets picked up. It was a joke. (Laughing) ... four Princeton (unclear) larger bankrupt packages. Can you picture (not clear) ever wearing this thing.(Laughing) BT52, DECs newest version of (not clear) (Laughing) So, and the other is, the one I was trying to find is, it, it, it was one of the HP3000, brand new operating system, post-UNIX. Talks about the editor and says that, The editor edits um um binary um card images 84columns -whatever, some magic number- in a variable format. Its a variable column format, with columns set to 84 and this is what their editor edits and theres about ten computations like that, describing, you know, formats. Record formats and what this has do to convert this to this, you know. MSM: Is the absence of those kinds record formats the reason why the UNIX editors had no concept of column? That is, if I am in a CMS editor, I can do column substitution, column searches, it not only has the notion of a line, but it has a column and I can go directly to it, do column locates and column changes. Thompson: I dont know, I think mostly, it has no notion of columns, because none of the languages have notions. Grant, if we edited Fortran, I assume that youd put a column thing in there. There are regular expressions that you can use to get your (not clear) at things. MSM: Just no one found that feature particularly useful. Thompson: If its a notion that you need or want then Im sure it will easily. I dont think it has anything to do with records, because, in fact, you know, the only thing important about lines there is newlines. There is a notion of lines and a notion of columns. Its just that we never (unclear) MSM: The story, as I gather, is that behind UNIX stood MULTICS. All of you been working on MULTICS, then the word came down: no more MULTICS. How did you feel about that? Thompson: Um. Mixed. Um. Technically, I thought it was a good idea that we were getting out of MULTICS. That it was too big, too expensive, too over-designed. It was just clear it was an exercise in building monstrosities. Efficiency would never come back to the point of where it was .... was cost effective and useful. Most of the efficiencies were dumped into features that were there because they were ... I dont know how to describe them. They werent there because they were good features, they were there because they were neat technical acts. Um. So, on one hand, I thought it was the right decision. Even then. On the other hand, we, meaning essentially Dennis and I, two or three others, had a ten million dollar personal computer. It was clear that this decision was aimed at getting rid of that. You know, the side effects of this decisions was that this thing was going out the door. Our personal way of life was going to go much more spartan. So, in that sense, we didnt want this decision to go. Um. Theres a deeper decision in it than just MULTICS, the crew wanted to work on MULTICS in Bell Laboratories, and thats that computer science research shouldnt work on operating systems. Operating systems were dead. This was the whole.... There was a whole change in thought at this point that, operating system research was dead. Um. Manufacturers, in a laboratory environment, you couldnt build a workable operating system. It really required a development kind of mentality and you know, grind it out. That we provide insight, but we couldnt build one. They were too big, too expensive to build or maintain. The whole computer science research was going to go back to theoretical, paper and pencil kind... There was a signaling of a very strange change here, at that point. Essentially getting out of the computing type of computer science as opposed to the theoretical type. When we persisted we were almost outlaws. We had to beg and borrow machines from weird places and weird sources. MSM: Why did you persist? Thompson: Its what I do. MSM: You wanted to work on operating systems? Thompson: Well, no not per say. I just wanted to work on computing and programs and it wasnt in essence no operating system. I never really viewed almost anything I did, as what I worked on. Its what I wanted to do next, for some other goal. After MULTICS went away and things settled after this, our computing environment.... Computer science and the Computer Center were one, and it split and the Computer Center went off to the services area, you know, like people who do the air conditioning. Computer science went into research. Um. We then had to go over a fence to talk to the computers. The computers were not with us anymore. We were a service organization where, you know, you had input boxes and output boxes and submitted cards over a counter. Very, very different approach what we were used to up until this point when we, since it controlled everything. The operating systems became vendor-supplied. In particular we went GECOS, and a word on top of GECOS, called TSS. Which was their time sharing system. Which was nothing but batch card entry. Quick turnaround batch card entry into the batch world. Thats what they call it: TSS with a partition for editing. It was horrible just to use that. The operating system, I think was just a (not clear) to get into a environment (not clear). MSM: I was thinking about this yesterday. As you may know from what Doug has said, Im doing a history of software in general, during the 50s and60s, working up to the roots and the kind of thinking that was going on in the late 60s as the software crisis emerged. Basically the question: how did the industry get itself into that, that situation? I was thinking about the operating systems of the 60s, which, if I understood them correctly, as someone who, when he was programming in the late 50s for a small company, still on the machine at night and worked at the console that to debug a program. I never went through that: hand on your cards and wait until the next day to get your output, first stage of program computing. That the notion of the operating system was to make the machine efficient. That the notion of a system like UNIX is more making the program more efficiently. As its a programmers system rather than Thompson: It was a combination of both. I mean theres reason they would be mutually exclusive. Um, um. The talk of the day in the conventional wisdom, which I never really bought, was that they were mutual exclusive. MSM: That was the feeling at the time? Thompson: Yes, and that um, time sharing would never survive because, youre spending all of your time on this big mainframe, you know, all floating point hardware and all of this stuff, you know, fielding these ratty little interims from people typing on flex-o-writers. And it was self-fulfilling prophecy, they believed that, in the systems they that built. Believing that, demonstrated that. Because, it makes it what it had to be. I think that in time sharing you can do better than batch. That you have a better mix of things to do and you can do scheduling in such a way that you just cant get in batch. MSM: Follow that up, because, again, there is the lore that has grown up around that. On one hand, I gather that what you all felt most strongly about at the end of the MULTICS project, other than the fact is that you have a ten-million dollar personal computer, was that notion of communal or convivial computing, that is that you have been able to share files with one another, become a medium of communication among you and that you felt - Doug at least said he felt that that really hurt to lose out. Then the other story is that UNIX started off as a personal system. A one-person system. Those two stories (People laughing) arent entirely compatible. That is...did you have a notion when you started UNIX of restoring that sharing? Was that in from the beginning? It was going to be multi-user system from the start? Thompson: Not, explicitly, I think. I was more interested myself. Just selfish notions of trying to get a environment to work in. MSM: Were you trying to build a programming environment for yourself? Thompson: We always wanted to expand it and turn it back into communal things. We were always trying to get machines that we could take home, you know and share among wider groups of people. Theres massive amounts of software that had to be developed, languages and all applications and all sorts of things. You just cant sit there with that Model 33, you know, wired right into a computer and do it all yourself. You can get your own work done, but you can really work faster if theres a community of ideas, a community of help. Application programs you can use and rely on. (People talking in the background) MSM: As you were the developing the system did you have it in mind to keep that option open at all times, with decisions informed? Thompson: Well, it was always time sharing in that sense. Sometimes it was a single-user system, but, it was always a time sharing system. I think it was implicit. It was never voiced, but it was always meant to be a shared system with lots of users. MSM: When you and Canaday and Ritchie, I think that's the three, settled down to find a file system, what were you looking for? Because, the file system you designed looked like, if I understand it correctly, looked a lot like the MULTICS file system. Thompson: Up to the point of writing simulators. Ah. The idea of the file system was to um, to have the activity locus of manipulation of data for user one and user two.... to be disjoint, so that in fact, wouldnt be locking common tables. Wouldnt be going through anything common unless we in fact shared files. To try to keep up real high, efficient access to disks. In fact, interleave accesses in a way. If two users... one user would expect some sort of response call or whatever it is and that at least with the disks of the disks of the day, two users will be able to command it and interleave seek times on the disks, and would not degrade each other. That was the idea behind the file system and the design; to move the addresses to the point where things could be cached and that your working and my working wouldnt interfere with each other in a locking sense or in a real sense in any way that (not clear). Um. I had built this system in a high level simulation of the whole file system and had gotten as results that these common disks of the day that in fact, you could enter(not clear) of your requests and get lots and lots of users happy at the same time. MSM: Was this the one you were doing on the 645? Thompson: Yeah. I was doing it on the 635 at the time. Yeah . I got these exponential curves where before it would get into trouble it would go way out and get lots and lots of simultaneous accesses going... I was playing with a disk sorting algorithms and caching algorithms at the time. All of those actually went into UNIX. Um. MSM: This would be the research aspect of the work? Thompson: Yeah. Then in the actual design. At that point, it just went to... There was a model of a user and a model of this, and they generated activities, and the activity went into the disks that were sorted and things like that. Um, um. It was never down to a design to the point of where you put the addresses, how you expand files and things like that. It was never down to that level. It was always at some higher level. I think it was just like one or two meetings, Dennis and Canaday and myself. Was just discussing these ideas of the general nature of keeping the files out of each others hair and the nitty-gritty of expanding. Of the real implementation, where you put the block addresses, where you put this and this. I remember, um, we did it in Canadays office. At the end of this discussion Canaday picked up the phone, and there was a new service in Bell Laboratories, dictation, where you call up essentially a tape recorder and you give notes, and then the next morning notes are typed and sent to you. The next day, these notes came back and the acronyms were butchered, like inode was eyen (Laughing) MSM: You should see the transcripts of your 81 interview. (Laughing) Thompson: So, we get back these, (unclear) description and they were copied and we each got copies of them. They became the working document for the file system, which was just built in a day or two on the PDP-7. MSM: But to the user it would look roughly the same as a hierarchy of directories. Thompson: No, the first one was a DG. In fact, it wasnt even a acyclic. If you understand the UNIX file system, it was.... there was the I-list, which is a definition of all the files on the system. And then some of those files, were directories which just contained name and I-number. Theres nothing in there that constrains it to a tree. So it was not in fact, not hierarchical at all. MSM: I see. Thompson: And we did not restrain it to a tree. We were experimenting with various topologies. What we ended up doing is turning into concrete and forcing the topologies that in fact were the topologies that came by convention from that system. The... Every time we made a directory, by convention we put it in another directory called directory - directory, which was dd. Its name was dd and that all the users directories and in fact most other directories, users maintain their own directory systems, had pointers back to dd, and dd got shortened into dot-dot, and dd was for directory-directory. It was the place back to where you could to get to all the other directories in the system to maintain this spaghetti bowl. So, I mean this tuff in various forms, which was strictly convention in this DG implementation of just random set of directories and files got forced into a typology that we maintained. When we started writing things like file systems checking programs and stuff, the locking of the spaghetti bowl directories and finding of disjointed things, I mean youd dissever something and never get it back, because you know youd lost it. Those problems became close to insurmountable, and so in the next implementation we forced a typology stronger than that. MSM: The PDP-7, you used the famous graphics machines you found. Um you went to when you found out you had in mind to just put the file system on there or ...? Thompson: At first, yes, we used it for other things, the famous space travel game, and it was a natural candidate of a place to put the file system. When we hacked out this rough design of a file system on the dictation that day in Canadays office, um I went off and implemented it on the PDP-7. MSM: Ok the PDP-7 was already around at that point. Thompson: Yeah. We had already done uh...wed spent a lot of the summer doing it... space travel...we had a lot of the pads worked out, we had assemblers and...the assemblers were actually on GECOS, and theyd generate paper tape and wed carry the paper tape down the hall and... MSM: Were you looking for a graphics machine, was that...because of the space travel game? Thompson: No, no, we used it because it was there, it was a graphics machine before. It was designed to be a circuit design system where youd lay out resistors and transistors and things. MSM: So originally you grabbed that from doing the s pace travel, worked up a certain number of tools on that in order to implement space travel, and then came the file system and you went to implement that. Thompson: The file system didnt exist by itself very long. What we did was... to run the file system you had to create files and delete files, re-unite files to see how well it performed. To do that you needed a script of what kind of traffic you wanted on the file system, and the script we had was, you know, paper tapes, that said, you know, read a file, read a file, write a file, this kind of stuff. And youd run the script through the paper tape and it would rattle the disk a little bit...you wouldnt know what happened. You just couldnt look at it, you couldnt see it, you couldnt do anything. Um and um we built a couple of tools on the file system...we used this paper tape to load the file system with these tools, and then we would run the tools out of the file system, thats called an exec by the way (laughter), and type at these tools that was called a shell, by the way, to drive the file system into the contortions that we wanted it to uh, measure how it worked and reacted. So uh it only lasted by itself for maybe a day or two before we started developing the things that we needed to load it. MSM: At what point did you feel you had something here? Thompson: Um, well, the first one was not at all multiprogrammed, and was almost like subroutines on the file system. The read call, the system read call, was in fact the call read of the file system and it was very synchronous, just subroutine call to the file systems for these applications. And um there was a very quick rewrite that admitted it was an operating system, and it had a kernel user interface that you trapped across. I really cant remember what the realization was, I mean, the whole time span, from initially starting with...walking downstairs, down there with the idea that we were going to build a file system. MSM: When was this, do you remember the time? Thompson: Yeah, it was the summer of 69. MSM: Summer of 69 ok Thompson: In fact um my wife went on vacation to my familys place in California to visit my parents -wed just had a new son in August 68- and uh they hadnt seen the kid so (unclear) took te kid to visit my family and she was gone a month to California and I allocated a week each to the shell, to the operating system, the shell, the editor, and the assembler, to reproduce itself. During the month she was gone, which was in the summer of 69, it was totally rewritten in a form that looked like an operating system, with tool that were sort of known, you know assembler an editor and a shell. If not maintaining itself, right on the verge of maintaining itself, to totally sever the GECOS connection. MSM: So that you could work directly on it. Thompson: Yeah. And from then on it kept pulling up files. MSM: So were talking about a months development. Thompson: Essentially one person for a month, it was just my self. MSM: Howd the others get involved? Thompson: um Doug got involved (unclear). Uh it was multiprogrammed...processes from the beginning, but it was just one console. And with just a little bit of work we turned the graphics scope into just another typewriter. You know, you print on the screen by inking characters all by hand as well. And so then it became two users, and it was constantly full, it was constantly at two users on it. (Unclear) got involved he was doing TMG, which was a compiler compiler language predecessory to the yacc kind of languages. Dennis got involved with ...during his language work. Uh (unclear) who was doing, he didnt do too much. I mean when it was in the PDP-7 form he didnt do too much. He did some... a number of theoretical kind of things. MSM: Who else was involved? Thompson: There were a lot of people involved, in a political sense, you know, trying to keep the machine for us, and get us the next machine, and that kind of stuff that werent doing programming. MSM: Who were these people? Thompson: Uh Peter Neumann, Lee McMahon, (unclear) Matthews. MSM: They were running interference with managers? Thompson: Yeah. Joe Osanna did for ... at that point also. Uh he later became very involved in the thing. His pet thing was to develop a um text processing system, to um, which you call a desktop publishing or whatever word processing. A text processor for... he had ideas about secretaries and typing pools. And he was constantly on the lookout for good typewriters, in the sense that secretaries would use, and that could use a touch type, you know, IBM Selectric type typewriters, that were computer interfaced. And wed go to almost every toy show, with this in mind. Looking for...I mean the industry was in sad shape at that point in trying to (unclear)things that we needed to accomplish some of these goals. But um everything that connected to computers was upper-case only, six bit generated and are very, very expensive. Theres the 1050 - you know what that is?- its an IBM Selectric but its about this big, and was loud and was about this tall on a console. So anyway they were interested in typesetting equation ... not typesetting but ... typewriter setting equations and doing TMS and documentation. MSM: So was it Joe figured this was something he could sell to management? Keep your system (unclear) going? Thompson: I dont know his motives. I wont guess his motives. Um I know he was genuinely interested in it, uh he in fact got a commercial type-setter and uh got it interfaced with the computer. Essentially ripped out the paper...it was meant to be driven by paper tape, and the paper tapes were to be, you know these typewriter to paper tape things, and what we did was we cannibalized the paper tape interface and just ran it over to a parallel interface on a computer, and we just punched paper tape...logical paper tape over to it over a wire. And uh it really had the first typesetting of this sort, so it was all way ahead of its time and that was all Osannas work. And it was all towards this ultimate goal of computer text processing. MSM: I know the um when I asked Doug about pipes in (unclear), the story that I was telling him when I was coming up to talk to him - my daughter who is a computer science/music major up at Harvard - said uh Well, what did he do?, and I said Well, hes (unclear) who had the idea of pipes. And she said, Oh, well, you ought to call this project pipe dreams. Uh I asked Doug about pipes and he talked about what the background to it had been, but he also told me that you were able to implement that overnight. Thompson: Yeah,well, Doug had was for years and years, well it seemed like years, I dont know the actual span was probably one year, Doug had uh, and he talked to us continually about it, a notion of interconnecting computers in grids, and arrays, you know very complex, you know, and there were always problems in his proposals. That what you would type would be linear and what he wanted was three-dimensional...n-dimensional...I mean he wanted just topological connection of programs and to build programs with loops and and you know horrid things. I mean he had such grandiose ideas and we were just saying, you know, God, its worthless, the complexity youre generating just cant be fathomed. You dont sit down and you dont type these kind of connections together. And he persisted with his the grandiose ideas where you get into Kirchoffs law problems, where you get into you know, what happens if you have a feedback loop and every program doubles the number of characters, you know, it reads one and writes two? You know, what happens to...its got to go somewhere you know. And you get these synchronization just, I mean theres just no way to implement his ideas and we kept trying to pare him down and weed him down and get him down, you know, and get something useful and distill it. What was going on, what was needed, what was real ideas, what was the fantasy of his ...and we there were constant discussions all through this period, and it hit just one night, it just hit, and they went in instantly, I mean they are utterly trivial. MSM: And that a reflection of the basic structure of the system or was it just coincidence? Thompson: No it was just we had control over it, it was our system. We could....it wasnt a big system, it wasnt a big thing to put in it was just, it just took minutes to do because we knew what... MSM: Is pipes the sort of thing...pipelines the sort of thing that can be implemented in any system or are there certain system requirements? Thompson: Uh well you really have to have real processes, and some places (unclear)data. Um for them to work in a um for them to actually work you have to have the notion of reading and writing streams, or whatever you read and write, and that the I/O cannot be different from the files. MSM: Oh so that goes back to that idea, that thats a prerequisite. Thompson: Yeah. Because if you have programs that sit there and read terminals, and then manipulate files back and forth theres just no way to connect them. Because what they read and what they write have to be the same thing. MSM: How long was this the skunk works when did you . .. well you said in the beginning you were building an operating system in spite of what was supposed to be going on. Uh when did you go public with it, within the company? Thompson: Uh we never really did. Um every step was painful . (Unclear) We couldnt have...uh it was an obsolete machine at the time the company the the, we didnt own it, uh it was another department that owned it, and when it would break, it would be a hassle over who maintained it, and we didnt maintain it because we couldnt get our department to pay for maintenance. There was, you know, no money at all but they just didnt want us to do this. We not only had to buoy this company, this department that owned the machine and wanted to throw it away, but to keep it, on their space and maintain it for us. That was a precarious situation, and that persisted. Then when it became clear that these machines were nearing the end of their life, uh we either tried to get them officially ours, which failed, our manager wouldnt pick up these machines, at zero cost, you know, they didnt want...the cost of the space. Then we started on a set of proposals for getting a new machine, through our management to replace it, to get a new machine, and they were all um... There was no explicit policy that we werent going to get back into the computer business, (unclear) we really know the rules, you know, but the rules were in effect. So what would happen was that we would take these proposals for these machines and do all the research on them and get the vendors in and waste everybodys time, and get these proposals up and theyd be thought about our management for a extended periods of time and theyd say no for some funny reason, you know, never for a real one (unclear) computing anymore. There were several, really several, of these big rounds of trying to get a vendor and a machine and, to get....to do this work. Most of it was carried on by Osanna and me, and the interference type people. Ultimately what happened was um we found a PDP-11, it was in fact not announced yet, but uh it was right on the edge of being announced. We would like the for the idea of text-processing we liked the expandible IO of the Unibus, where we could build our own interfaces, they had general purpose interfaces, they had lots of com gear, uh that we could do for...I mean it had everything. It looked like it was going to expand to any machine we wanted to make it. Um and these people, Osanna and I put together a proposal to buy a PDP-11 to do text-processing, research in text processing, (unclear) and document preparation, this type of stuff. Uh it was the first of the goals that were specific, uh we want to do this for this machine, um for this purpose. The other ones were...we wanted to play with computers and operating systems, and they were unspecific, and the our management went off and thought about it, and rejected it again. But in the meantime going up and down the hierarchy a sister department, 122, psychology research, uh came over and said well well fund it out of our area, embarrassed the hell out of our management. And they bought it, gave it to us, and... MSM: What were you looking for? Thompson: Well it was interesting, they thought it was interesting. They just had insight, and inspiration and unfortunately our management didnt. They were suffering from wounds, our management was suffering from wounds from the MULTICS days and you know ... MSM: MULTICS really hurt? Thompson: Yes. Lots of promises to lots of people to develop software that would be everything to everybody. It was sold, company wide, to be the computing utility. Thered be, there would be a plug for 110 volts, and right next to it there would be a MULTICS plug, and youd just plug it in and suck out whatever cycles you wanted for anything you wanted. You know it just, it would just be the utility, you know just like a power utility or a phone utility, it was just the computing utility. For everybody. Everybody would have all the cycles they wanted. It was sold big all the way down the company and... MSM: So it was a notion of once burned, twice wary . Thompson: Anyway the 11 came in, um it say for a month in Osannas office, because uh, it had no disk, the disk was delayed, it didnt come with it. And wed type stand-alone type things, this stuff, um. Then when the disk was just ready to ... you know the disk was just ordered and was on its way, they were actually starting to manufacture and we were on the waiting list, we brought the machine up next to the PDP-11, which was what we were working on, and we started writing all the cross stuff. In B. We wrote a PDP-11 assembler in B, and ran on the PDP-7 the PDP-11 assembly code and punched paper tape out of the 7, you know out of the...across the floor into the 11 and had fake file systems that were done in memory, and we got it almost running, the disk came in and in probably another week we got UNIX running on it...At that point a lot of things came into being...the topology of the directory structure was fixed on more convention than convention by that point... MSM: When was this, 1971 Thompson: Yeah, let me see, 71? Maybe 2? I dont know that. Its mentioned in one of the UNIX manuals, the dates rolled up....(unclear) And we moved over...Osanna...I was just interested in operating systems, I went along with the text processing (unclear). It didnt interfere with my plans so I ...went along with it. The editing, and the stuff around the text processing, and Osanna did the... went on to the nroff, troff stuff or the text processing. We instantly put all our secretaries on it. They did our mail messages and our documents and did that so we did text processing for that, then we uh as part of the demonstration Osanna got the patent people, patent application to come over - they were just about to buy a horrible little commercial type setting package- called, we shouldnt mention this...AstroText was the name of it...and it was just truly bad, and we could cobble together something that would be vastly superior to what they were about to pay real hard...you know a lot of hard money for. Um, and so we put their stuff together and developed a package for them that was specific to their applications, you know, they have very different kind of formatting (unclear). Um and in fact they liked it and they still had this money in the budget for this AstroText thing, and we talked them into buying our system, physically, you know, the hardware, move it out, and we took their money and bought an 11/45 with it. (Unclear)interim machine was a um. Before the 11/45 was available we bought a PDP-11 that had PDP-10 memory management, KS-1, it was a one of a kind machine, and that was the first time we ran the production of program development along with these -all in assembly language- along with these typists typing real applications and uh (unclear) on unprotected machines. MSM: You hadnt gone over to C yet. Thompson: No. C was fairly late. MSM: (unclear) DEC machines. Did DEC ever show any interest in what you were doing? Thompson: No. At one point we put a notion to them, and said um...the way it started running internally, is the word just got around, and these random groups would come in and say you know....everyone, technically would look around for a machine and choose a DEC machine, and DEC had no software, they were real late in the delivery of their software, and when it came it was horrible, just...that was probably the early reason UNIX thrived is because it had no vendor competition at all, none. It was the only software around for the DEC machine, and so theyd look around, theyd find DEC machines, they were just without technical peer. And a project would buy a DEC machine and theyd look around for software after that, and theyd hear our names, theyd come and talk to us. And theyd decide that they were going to run UNIX for their software development, develop their application and then run their application standalone; it never happened, they never got rid of UNIX. You know their application would run on top of UNIX (unclear). The story was always the same: that they were going to use software development, develop their application, and then deliver it with the application. And these things kept proliferating, more and more and more of these things, it was all underground. No one, you know, we were the only ones doing the development, and theyd want records or theyd want this or theyd want that, and wed tell them no, we didnt like that, doesnt fit into our plans, so to hell with it. Uh and thats how the UNIX development group got involved is to do the to be more responsive than we were to the needs of the people. (Unclear) were starting to put these machines in.(Unclear) telephone applications. MSM: Would you say... is this the point at which UNI X became standardized in some sense, got settled? Thompson: No, no um we had momentum, in our department, we were working...these guys were just fighting - the development group were just fighting to learn what it was. By the time they learned, it was something else. I mean things were really moving fast in those days, and they would spend most of their time, coming up to speed with some version theyd cloned in the past, and in the meantime there would be three more of their customers that would have cloned from us, because they needed some new thing that we had and, then theyd end up retrofitting our current version back into you know their version, and most of their updates were in fact taking our version out. And this went on for several years, where they were just some sort of conduit buffer, and trying to learn what was going on. Um probably an unenviable position for them to be in. And it wasnt until there was a second group from (unclear) that cloned a version of our system and started doing...going off in their own direction, really doing their own work for it themselves. And they merged um (unclear) and, and a combination of our system and their system turned into the development system, which was the standard system, which, I think, turned into System 3. And from then on they were fairly separate, and just took ideas rather than massive amounts of code. MSM: I was going to say, when did it wind down for you, or did it ever? Thompson: Um at some point it got ponderous, and I decided to get out from under it. And I did, I took a sabbatical at Berkeley, just disappeared for a year. And you know, if youre here, you are indispensable; if youre not here, you know, (laughing). MSM: Thats why Im going away next year... Thompson: Yeah so I went away for a year and when I came back it was just...I was just not in it anymore, not in the mainstream and not needed for(unclear). It was actually planned. MSM: So what did you go off to do? Thompson: Uh, (unclear) I actually did a lot of system development for them, it was the start of their ascension. Most of the names you know were in fact students of mine. MSM: I see...(unclear) the development of UCB. Thompson: Yeah...when I went there they had one UNIX machine . It was (unclear) statistics, that theyd run it three days a week and statistics would run it three and theyd fight over it the last day, or run maintenance on it that day. When I left it was in almost every one of their courses. They had about three machines on order, they had three or four machines installed, real confident students. MSM: Looking back (!phone!)...just one more, because we have been going for a long while. Um you look back on it...is there something fundamental youd like to have done differently? Thompson: Um, I had regrets about a couple things. Um probably the biggest thing is I had some little lash-up applications, uh with remote shells, and distributed machines where you had a shell where you could execute pipelines with different parts of different machines. Um and I never pursued that, and because of it theres these, you know, the stuff that we laid out and distributed was hardly ever changed; our file system, the composed read/write, the pipes, and you know all these things. The stuff that we left fuzzy, got done either poorly or multiple ways and their different, different systems and their addressing strange (unclear). And I think that if we had worked harder, had the insight or done more in networking in those days then you know things would be different. But uh it was, its, its nothing that I could have predicted, it had to be in retrospect to think of that. I dabbled in that area, and just never, never installed it, never distributed it as part of the system. MSM: Its always easy to be wise after the fact, and hard to imagine how one thought otherwise about certain things, but, one thing about these timesharing systems of the late-60's...operating systems and the notion of making them time-sharing was the shared notion that computing was going to become generally available, it was going to be through a plug in the wall to a large central computer, when, in fact, thats not how computing has become available to people at all. Were you still thinking in the late-60's early-70's when you were doing UNIX about using a central computer, or did you... Thompson: Yeah, in fact, I still think that way. Um in those days I typically thought of using one central computer, um mainly because of the expense and stuff like that, you know, RAM, and lack of networking although Id done the interconnection of UNIXes to some extent. But now I am thinking of still central computing, but with multiple central computers, designing new operating systems that way, um I think that there... the comp centers maintain hardware better than people do in their offices. And um if you compute in your office, like a workstation mentality notion, that you are always stuck with a small machine, that you cant afford, on that machine, to put a hundred megabytes, but uh, on a central machine you can, and that for short periods of time you can use the 100megabytes... um for you applications. And that the sum of these, the distributions of how much memory you need and how much I need averages out much quicker on big machines than they do with one person with one machine on your desk. So I think that small amounts of sharing in central computing is better for everyone; its cheaper and everybody gets better service and better cycles than they do on their machine on their desk. So I still feel that way. MSM: But it would be a distributed system. Thompson: Yeah, it would be several of these uh compute servers, call them whatever they are, but theyre just there for these economies of scale, and you get these economies of scale with a few users. MSM: Ok... {END} Ken Thompson, page  PAGE 8 $%''I S JLhr",5?S^ $*ip3 5 f r j#t#$ $8$<$e&i&((5*?*......&/0/81B123~99>>M>W>r@|@OEYEFFFFeJoJJJJJLLLLHLILJM5CJOJQJCJ CJOJQJ^$%&+ , H I JKg$1$` 80@ P !$`'0*-1$` 0@ $1$` 80@ P !$`'0*-$%&+ , H I JKgh!"45  ST3 4 f h E#F#i#j#((((((4*5*. .....%/&/007181c2d222@9A9}9~9==>>*>+>L>M>@@q@r@EENEOEFFFFcgh!"45  ST1$` 0@ $1$` 80@ P !$`'0*-3 4 f h E#F#i#j#((((((4*$1$` 80@ P !$`'0*-1$` 0@ $1$` 80@ P !$`'0*-4*5*. .....%/&/007181c2d222@91$` 0@ $1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*-@9A9}9~9==>>*>+>L>M>@@q@r@EENEOEFFFFFF$1$` 80@ P !$`'0*-FFFFFNJOJdJeJvJwJJJJJKKLLHLJLJMLMOO.P0PTTUU@WBW^W`WWWWWYYZZWZYZ^^#`$`7a8arasabbOcPcCkDk_k`kzk{kkkppttdueuuuww?{@{{{|||~}~ԅՅ&'\]ӋԋdFFFNJOJdJeJvJwJJJJJKKLLHLJL$1$` 80@ P !$`'0*-1$` 0@ $1$` 80@ P !$`'0*-JLJMLMOO.P0PTTUU@WBW^W`WWWWWYYZ$1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*-JMKMLMVMOO.P:PUUUU@WCW^W_W`WjWWWWXYYZZWZXZYZcZ$`.`sa}aPcZc`kjkkkttuu@{J{||  Յ߅\g(JTXZik!#hrMW£`jl6CJOJQJ CJOJQJCJ^ZZWZYZ^^#`$`7a8arasabbOcPcCkDk_k$1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*-1$ 0@ _k`kzk{kkkppttdueuuuww?{@{{{|||~}~$1$` 80@ P !$`'0*-ԅՅ&'\]ӋԋIJՎ֎1$` 0@ $1$` 80@ P !$`'0*-IJՎ֎ gh&'deLMwxUV9:_`MNkl23PQĨŨ+, ׹عhiлѻabHI :;d֎ gh&'de1$` 0@ $1$` 80@ P !$`'0*-LMwxUV9:_`MNk1$ 0@ $1$` 80@ P !$`'0*-kl23PQĨŨ+,1$` 0@ $1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*-lvQ[ĨϨisѻۻ47IS;Ez,6=GIS !()<=CDEFGJ 0JmHnH0J j0JU56CJOJQJ CJOJQJCJ? ׹عhiлѻab$1$` 80@ P !$`'0*-HI :;STyz+,qr$1$` 80@ P !$`'0*-;STyz+,qrtu;<<=HI ")GJ/tu;<<=$1$` 80@ P !$`'0*-1$` 0@ $1$` 80@ P !$`'0*-=HI ")GHIJ$$1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*-  0 0&PP/ =!"#$%...()()()..)() [0@0Normal1$ hmH nH ` Heading 1N$1$`@& 80@ P !$`'0*-5CJOJQJ<A@<Default Paragraph Font,O, Default ParaCJ,@,Header  !, @,Footer  !&)@!& Page NumberJ "JMlJg4*@9FJLZ_k֎k=JF;J"!4 $*&&''''..w3z3#7)7O8V8X8_8k8p8u8|8~88CCEE&E*E`EdEFFFFS"SYY?^G^ccprxr|| |'|HO_hćik!#xЙߙOQ08BNVZdkڤCL3;ox@I9?)HKabCNPmOP 25-Y D!!#$$&o----m22355577~88::==>>I?M?q?AAABB`CdCDDEEEE=HGHMNNNdPgPRRVVVV3W7WWX\\__e_h_aaaaabbbTcWcddHeMehh`ihiiillopp'pppStu>vRvwwxx #mHO8T8I̊Z`CF^~=Az{OPXqʧԧ)4b«ݯr̸Ը}>?\e6:R RX 6v)HKMichael S. Mahoney1C:\WINDOWS\TEMP\AutoRecovery save of THOMPSON.asdMichael S. Mahoney:D:\My Documents\Research\unixhistory\INTERV~1\thompson.doc@LLn`LLJ@GTimes New Roman5Symbol3& Arial9CG Times"Ah$F$F,#f!2d:KEN THOMPSON 9-6-89Alla KrutyanskyMichael S. MahoneyOh+'0x  4 @ LX`hpKEN THOMPSON 9-6-89EN Alla Krutyanskylla Normal.dotnMichael S. Mahoney2chMicrosoft Word 8.0@F#@6 m@6 m,#sh program. I just happened to meet him at a reception at the computer museum at Boston. We started talking about Xerox PARC: how did you get your assignment and what was your mission? You know, there was a great deal of similarity. Well, it was sort of a general mission to do interesting things and hope they work out, but look around for something interesting to do and get going on it. He said he was given two years to find something to do. He sat there and he played with Paintbrush, which he had done back in '73, and it was brilliant.

When did you become the group's scribe?

Kernighan: I think at some point fairly early in game, I started writing tutorials. Sort of, how do you use it? Gerry Markey, who is now Sandy Fraser's secretary, said to me one day, "I don't really understand how to use qed," which was the text editor, and I said, "Well why don't I write down something that will, sort of, tell you how to use it." And I wrote a tutorial on qed. Now, I don't know if it ever did Gerry any good or not, but a lot of people found it useful. It was a sort of, here's how you get started on this kind of stuff, and it was a particular style of writing that nobody that else seemed to be interested in doing. Which was sort of-not a manual, but a "how to do it" tutorial. No better word.

I had already written one of those for my little formatter at Princeton, in fact, so it wasn't the first time I had done it, but this was, I guess, the first time I, sort of, consciously did it. I did several like that. I did one on B; the one on B mutated into the one on C, which then mutated into a C book. And, you know, a variety of others. I did a "cave guide" to the Murray Hill computer center, an underground guide to the Murray Hill computer center, which was (laughing) sufficiently against the received wisdom that they didn't want me to publish it. But I published it anyway. Which was, sort of, one of the useful programs, as opposed to the ones you will find in the manual. That kind of stuff. I guess, from there it's not too big a step to writing things that describe what's good about the operating system, or the environment, or the way of doing things-these sort of pseudo-philosophical papers that explain what you could do when you connect programs together, and what you could do when you had a programmable shell, and that kind of stuff, which, where I took basically one paper and probably wrote it about fifteen times. But that kind of thing. So, I think that's part of where this writing came from.

The other aspect was book writing, which in the long run is much greater effect. I think you have much more impact if you have a successful book. I still remember quite clearly how I got started in that. I was enormously lucky when I came here the first summer to be in the office next door to Dick Hamming. I'd heard of Hamming codes because I had taken a course in coding, error-correcting codes at Princeton. I was sitting in my office the first day, as we are sitting here, and this guy came in from next door at eleven o'clock and he said to me, "Hi, I'm Dick Hamming, let's go to lunch." I said, "Well, okay," and he dragged in Vic Vyssotsky, who was right across the hall from me, and we went off to lunch. Later on I discovered, this was the famous Hamming of Hamming codes, and the numerical analysis book that I had used ՜.+,D՜.+,T hp  Princeton University6f:  KEN THOMPSON 9-6-89 Title 6> _PID_GUIDAN{AD84CA6C-D95A-11D1-A499-346F01C10627}ers how to write programs is we give them a grammar and a dictionary and we say, "Okay, kid, you're a great writer." That's the way programming was taught according to Hamming, and there's a grain of truth in it. He said, "What we really need is a book of style; here's how to write well." I don't remember in detail, but his idea of how to write good programs was, I think, pretty half-baked at that point. But, one day he came into my office and he handed me a book and said, "Look at this!" (searching for book) I don't think I still have it down there. I used to have it. It's probably down there somewhere. He handed me this book, and he said, "Look at this! This is awful!" It was a FORTRAN program. It went over two pages. What he was talking about was the numerical analysis in this thing, but what I saw, when I looked at it, was this horrible piece of code, which is the first example in the Programming Style book. I looked at it, and said, "Jesus Christ!" I wrote on it in green, "Jesus Christ" (laughing) and then it occurred to me. I know what I can do, because I had somewhere stumbled across Strunk & White, which is basically an "awful, good, awful, good," you know, side by side. You could make a book out of that. You go off and you find awful examples and you show how to do them right. Bill Plauger at the time was in the next office, and he kind of got intrigued by the idea. So, we went off and we hunted the libraries, all the libraries, all of Bell Labs' libraries, and any other place that we went. Bookstores and everything. And we found awful examples, and it was easy to find them. There were just zillions of awful examples, because every programming textbook was awful. We went off and wrote-basically just collected these, tried to get them in a coherent form, where an example would illustrate some principle or guideline on how to write well. Then we just threw it all together and wrote a book. It was, I think, certainly a fun book to write. (Laughing) My wife said to me, "You found your ecological niche."

MSM: I've been looking for a copy. I can't find it anywhere.

Kernighan: I'll find you one. I can probably do that. (searching for book) I'm sure I have one down here, somewhere. Fun book to write, and I think that's how got I started in book writing, at least. Then Plauger and I wrote the Software Tools book shortly thereafter, and then I browbeat Dennis into working on the C book with me.

MSM: You just found you like to write?

Kernighan: I like to write-ultimately, it was deemed to be good thing at the labs. I think when I first wrote that book, it was deemed to be neutral. It wasn't like a positive thing, but I'd only spent about three to six months on it, so it wasn't a bad thing either. It was just a neutral thing, and it was only sort of retroactively that it was deemed to have been a good thing. I think Plauger got fired for writing it.

MSM: I want to talk about where he went in a second, but there's an obvious question. When someone takes other people's style and says, "This is the way to do it," and when you talk about its being relatively easy to find examples of bad code writing-where did you learn to write programs? Wher  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entry K<@My DocumentsMYDOCU~1 1 Fp hm 1Table1WordDocumentSummaryInformation(DocumentSummaryInformation8CompObjPJؙCȀjsoft Word TahomaP*P P%  MSOUNISTATWord has completed ch of the document and h  FMicrosoft Word Document MSWordDocWord.Document.89qࡱࡱ> Oh+'0x  4 @ LX`hpKEN THOMPSON 9-6-89EN Alla Krutyanskylla Normal.dotnMichael S. Mahoney3chMicrosoft Word 8.0@ @6 m@m*#tsh program. I just happened to meet him at a reception at the computer museum at Bost՜.+,D՜.+,T hp  Princeton University6f+  KEN THOMPSON 9-6-89 Title 6> _PID_GUIDAN{AD84CA6C-D95A-11D1-A499-346F01C10627}ers how to write prolvQ[ĨϨisѻۻ47IS;Ez,6=GIS !()<=CDEFGJ ptx 0JmHnH0J j0JU56CJOJQJ CJOJQJCJC 0 0&PP/ =!"#$%...()()()..)()MSM ,, ,,, sort of cuMel Butler, Lampson, Peter Deutch24 =HI ")GHIJvx$$1$` 80@ P !$`'0*-$1$` 80@ P !$`'0*- [0@0Normal1$ hmH nH @ Heading 1N$1$`@& 80@ P !$`'0*-5CJOJQJ<A@<Default Paragraph Font,O, Default ParaCJ,@,Header  !, ,Footer  !&)@!& Page Number=EF%&XZ78[\$$u$v$$$&&'&))****++,,)-*-U.V...2535o5p599::::>:?:<<c<d<A A@AAABByBzBBBBB@FAFVFWFhFiFFFFFGGHH:HIKK L"LPPQQ2S4SPSRSSSSSUUUUIVKVZZ\\)]*]d]e]^^A_B_5g6gQgRglgmgggllxpypVqWqqqss1w2wwwxxnzozzz{{||ƁǁNOŇƇ;<NJȊՊ֊܏ݏYZVW>?ijGHuv+,QR?@]^$%BC|}ɵʵZ[|}·÷STuv}~:;,-EFklcdfg-../ :;:>@ #JMlxg4*@9FJLZ_k֎k=xF;J#!4 s&z&''''..i3l377A8H8J8Q8]8b8g8n8p8w8CCE EEEREVE{FFFF SSYY1^9^c cbrjr| |||:AQZ}[]js™љAC"*4@HLV]̤Ҥ5> %-ұܱ|wu}aj2;+1;>UV5@B_AB$'K6!!##$%a-u---_2{2355577Q8X8::==>>;???c?AAABBRCVC~DDRE[EEE/H9HMNNNVPYP R RVVVV%W)WWW\\_ _W_Z_savaaaaabbFcIcdd:e?eh hRiZiiilloopppptt0vDvwwxx_y:A*F{|*;LR58Pۘpv/3lmABJcƧ&T}dܸ۹ oܿ01NW(,DDyMQ(h;>Michael S. Mahoney1C:\WINDOWS\TEMP\AutoRecovery save of THOMPSON.asdMichael S. Mahoney:D:\My Documents\Research\unixhistory\INTERV~1\thompson.docMichael S. Mahoney:D:\My Documents\Research\unixhistory\INTERV~1\thompson.doc@~~n~~` #$CDUa68;<=0@116 @1 1: @1 1~ @1 @11 @1 @14 @11\ @11d @11 @10 @1.1l0@0@1R@1p0@0t0@GTimes New Roman5Symbol3& Arial9CG Times"Ah$F$f*#tf!2d+KEN THOMPSON 9-6-89Alla KrutyanskyMichael S. Mahoneythat goes into to building that kind of complicated architecture is totally wastG Jbjbjَ !]TTT89*XXnnnnnn((((((($)+-(ennnnn(&nnX&&&nRnn(n(&&((n4$PmnT!&(Root Entry K<@My DocumentsMYDOCU~1 1 Fp hPm-@1Table1WordDocument&SummaryInformation(   !"#$%'*/,DocumentSummaryInformation8CompObjPJؙCȀjso0Table TahomaP*P -  MSOUNISTATWord has completed ch of the document and h _PID_GUIDAN{AD84CA6C-D95A-11D1-A499-346F01C10627}ࡱOh+'0x  4 @ LX`hpKEN THOMPSON 9-6-89EN Alla Krutyanskylla Normal.dotnMichael S. Mahoney3chMicrosoft Word 8.0@ @6 m@  FMicrosoft Word Document MSWordDocWord.Document.89qࡱ՜.+,D՜.+,T hp  Princeton University6f+  KEN THOMPSON 9-6-89 Title 6> m*#tࡱࡱ> (+.)  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~