Thompson: I don’t know. I think it’s losing at Google. Now there aremore people who don’t like it than like it.
Seibel: And they switch to Java?
Thompson: I don’t know. There’s almost no replacement for it. Theycomplain, but they don’t switch. Graduate students coming out—the peoplewho are hired by Google—know it. So it’s hard to do anything else. That’sthe reason it keeps going—it saves a tremendous amount of education, reeducation.It gets people productive faster.
Seibel: Are there other languages that you enjoy, or have enjoyed,programming in?
Thompson: All of the funny languages at one point I’ve taken a step in.Like for solving equations and stuff: Maple and Macsyma, things like that. Forstrings, SNOBOL. Anyway, I’ve played with dozens and dozens of languages,if they do something that’s interesting.
Seibel: And are there development tools that just make you happy toprogram?
Thompson: I love yacc. I just love yacc. It just does exactly what you wantdone. Its complement, Lex, is horrible. It does nothing you want done.
Seibel: Do you use it anyway or do you write your lexers by hand?
Thompson: I write my lexers by hand. Much easier.
Seibel: Have you ever done any literate programming, a la Donald Knuth?
Thompson: No. It’s a great idea, but it’s almost impossible to do inpractice.
Seibel: Why?
Thompson: It’s two representations of the same program that are oftenout of phase and conflict with each other. And there’s no way to resolve it.If something is written well in a programming language, then it’s readable. Itsuffices. The comments don’t need to be that parallel. The comments aremaybe for algorithms, or if you do something tricky it’d probably be more inthe form of a warning or something. I’m not a big, gross comment kind ofguy. It’s legendary.
Seibel: When I interviewed him, Knuth said the key to technical writing isto say everything twice in complementary ways. So I think he sees that as afeature of literate programming, not a bug.
Thompson: Well if you have two ways, one of them is real: what themachine executes. One of them is not. Only if one is massively more briefway than the other is it worthwhile. If it’s the same volume, you read theone that works. If one is much more terse, much less precise, and you canget out of it what you need, then that’s great. But very often you can’t getout of it what you need—you really need the nitty-gritty and then you go tothe other. Depending on what you’re after, you read one or the other. Butto try to have microscopic descriptions of an algorithm, one in theprogramming language and one in English—maybe Knuth can do it, but Ican’t.
Seibel: Have you ever read any of his literate programs?
Thompson: Just his stuff in the early papers. Nothing recent.
Seibel: And are there books that you think are particularly important—thateither were important to you or that you would recommend people toread?
Thompson: I don’t read beginning programming books, so I have troublerecommending such things. If I have to learn a new language or somethingI’ll try to find a book. I prefer much denser books that just give me thesyntax and semantics rather than chatting me up and telling me what’s goodstyle and what’s bad style.
When I taught, I would have to select a textbook for my course and wouldread all of the textbooks in the area and have to make a selection. So at twopoints in time, I knew the basic literature for those courses. But outsidethat I don’t read.
Seibel: When you were inventing Unix you had your plan to do the fourpieces that would actually give you an operating system. Then your wife andkids went away, leaving you free to hack for a month. I assume you put insome long hours in that month. Why do we do that? Is it necessary? Is itjust because it’s fun?
Thompson: You do it when you’re driven. I don’t think I could have notdone it. The other thing is when the wife and kid are around you have thissynchronizing to a 24-hour cycle. When they go away, I don’t have a 24-hourcycle. There’s nothing that keeps me and the sun together. And so Itypically sleep on a 27- or 28-hour cycle, sleeping 6 hours. So I drift. When Iget to sleep until I wake up I’m in better shape to work than if I get to sleepand get up when the kid starts screaming.
Seibel: So that’s when you’re driven by a project and you wake up wantingto get to the computer to start writing more code. But people also worklong hours because we have this idea that we’ve got to get this product outthe door and the way to do it is for everyone to work 80, 100 hours aweek.
Thompson: That generates burnout. Excitement programming, I neverever felt stress. I’ve been in other situations too where deadlines—externaldeadlines—generate stress. That’s not fun; I don’t like that.
Seibel: You burn out at the end, which is obviously bad, but in terms ofgetting things done in the short term, does it work?
Thompson: Usually you’re in a position where such a thing is continual.That as soon as that deadline is over another one starts coming up over thehorizon. If you’re constantly under deadlines like that, then the next oneyou’ll have less enthusiasm and pretty soon you just can’t live like that. Ican’t.
Seibel: Tied up with trying to meet deadlines is being able to estimate howlong things are going to take. Can you estimate how long it’s going to taketo write a given piece of code?
Thompson: It depends on whether I’m writing it for me or writing it forproduction. I can if I’m writing for me. I can live with the quirks. I can notdo the extra ten percent. I can avoid the gaping holes that I know are inthere. Things like that. I can produce it and then clean it up at leisure andstill use it. Maybe that’s a different definition of finished. But ifyou’re doing it for production then usually there are other people involved andcoordination—I can’t estimate that.
Seibel: In one 1999 interview you said you didn’t think much of Linux, andgot the Linux guys all up in arms. What do you think of it now about adecade later, and it’s taking over the world?
Thompson: It’s much more reliable—there’s no doubt about that. And I’velooked at the code occasionally. I don’t look at it as much as I used to. Iused to, for Plan 9. They were always ahead of us—they just had massivelymore resources to deal with hardware. So when we’d run across a piece ofhardware, I’d look at the Linux drivers for it and write Plan 9 drivers for it.Now I have no reason to look at it. I run Linux. And I occasionally look atcode, but rarely, so I can’t really tell whether the quality has gotten betteror not. But certainly the reliability has gotten better.
Seibel: Do you ever read code just for fun?
Thompson: In the past I used to; less so now. When I first came here I didit just to try and get the feel of the place. You’ve got to. There’s so muchunsaid that you’ve got to know.
Seibel: Would you pick a program and completely understand it, or wereyou just sort of looking for how do they do things around here?
Thompson: A little bit of both. I’d certainly try to pick the big libraries atfirst. I’d look at the main programs of some of the things. The programmingstyle here at Google is so bizarre. They take a subroutine call, package it asan RPC, and store it somewhere static. Which means anybody can call it atany time for any reason. And then they call generic listening kind of codeand somebody somewhere gets a message, goes off and finds that, andmakes that subroutine call.
Seibel: So that’s a mechanism for distributed computation.