Part of the problem is there are different garbage-collection algorithms and they have different properties—massively different properties. So you’re writing some really general-purpose thing like an operating system—if you’re going to write it in a language that garbage-collects underneath, you don’t even have the choice of the algorithm for the operating systems. Suppose that you just can’t stand big real-time gaps and you have a garbage collector that runs up to some threshold and then does mark and sweep. You’re screwed before you start.
So if you’re doing some general-purpose task that you don’t know who your real users are, you just can’t do that. Plus, garbage collection fights cache coherency massively. And there’s no garbage-collection algorithm that is right for all machines. There are machines where you can speed it up by a factor of five or more by messing around with the cache. They should be tied to the machine much more than they are. Usually they treat them as separate algorithms that have nothing to do with machines, but the cache coherency is very important for garbage-collection algorithms.
Seibeclass="underline" Do you think of yourself as a scientist, an engineer, an artist, a craftsman, or something else?
Thompson: I don’t know. I hate to use the word scientist because I think it’s elitist. And implies a PhD. There’s no certificate that says “scientist” on it when you complete the scientist course, so I don’t like the term or use it. Engineer, I do have a degree that says “engineer” on it, so I can use the word engineer. And when I fill out an occupation I either put engineer or programmer because I can justify those. But mostly I just don’t worry about it.
Seibeclass="underline" Well, leaving aside what you call yourself, who do you feel the most affinity with? Is it a physicist, a guy who builds bridges, a painter, or a carpenter?
Thompson: Kind of the lower things. I believe a craftsman but with a certain amount of artistry to keep it alive.
Seibeclass="underline" How do you identify talented programmers?
Thompson: It’s just enthusiasm. You ask them what’s the most interesting program they worked on. And then you get them to describe it and its algorithms and what’s going on. If they can’t withstand my questioning on their program, then they’re not good. If I can attack them or find problems with their algorithms and their solutions and they can’t defend it, being much more personally involved than I am, then no. At the same time you can get a sense of enthusiasm. It’s not something you ask directly, but in the conversation you’ll come with this enthusiasm-ometer, and that is tremendously helpful for me. That’s how I interview. I’ve been told that it’s devastating to be on the receiving side of that.
Seibeclass="underline" I would imagine. It’s sort of like an oral exam. Do you suppose you’ve ever run into people who just didn’t have the personality that can deal with that, independent of their programming ability?
Thompson: No, I don’t think it’s independent of programming. It would be if I started asking them classical computer-science kind of questions, but that’s not what I’m asking them. I’m asking them to describe something they’ve done that they’ve spent blood on. I’ve never met anybody who really did spend blood on something who wasn’t eager to describe what they’ve done and how they did it and why. I let them pick the subject. I don’t pick the subject, so I’m the amateur and they’re the professional in this subject. If they can’t stand an amateur asking them questions about their profession, then they don’t belong.
Seibeclass="underline" What are you doing here at Google?
Thompson: Infrastructure. Operating-systems kind of stuff. Glue between the pieces. I have a charter for anything I want. The challenge is to get a bunch of unreliable machines to work like a reliable multiprocessor machine. I guess that’s the closest thing.
Seibeclass="underline" Isn’t the point of Google’s famous MapReduce machinery that it’s shared-nothing message-passing rather than a shared memory?
Thompson: Well, it’s a process that has well-known semantics and no feedback loops. If you have a reliable structure to do that, you can fit a lot of problems into that structure.
Seibeclass="underline" And are you working on things within that kind of framework?
Thompson: No, it’s just trying to keep the burden of reliability off the individual programmers. It’s a real tough challenge. All the software here has layers and layers and layers of what happens if this doesn’t work, what happens if that doesn’t work. What happens if I don’t work—who kills me and who starts up, who does what. I would guess way more than 50 percent of the code is the what-if kind.
Seibeclass="underline" So your goal is to have that half of the code go away?
Thompson: Well, it would be hidden somewhere. It would apply in a systematic way to the other code. Hopefully. It’s a hard job.
Seibeclass="underline" Do you like working here at Google?
Thompson: Parts of it I like, very much. But parts of it are just ponderous because there’s money involved in bugs and there’s money involved in lots of the stuff. The size is unimaginable. Like day one you kind of get something crippling along and day two you’ve got two million users. You just can’t imagine such a thing.
Seibeclass="underline" And you’re actually on the production side. As opposed to being in Google Labs, which might be more akin to your past at Bell Labs.
Thompson: But I’m not actually production either. I’m in projects that will become production. But I don’t babysit them after they’ve gone. Probably my job description—whether I follow it or not, that’s a different question—would be just to find something to make life better. Or have some new idea of new stuff that replaces old stuff. Try to make it better. Whatever it is that’s wrong, that takes time, that causes bugs. If there’s anything in the structure of Google, anything that you can put your finger on that could be done better, try to do it better.
Seibeclass="underline" I know Google has a policy where every new employee has to get checked out on languages before they’re allowed to check code in. Which means you had to get checked out on C.
Thompson: Yeah, I haven’t been.
Seibeclass="underline" You haven’t been! You’re not allowed to check in code?
Thompson: I’m not allowed to check in code, no.
Seibeclass="underline" You just haven’t gotten around to it, or you have philosophical objections to the Google coding standard?
Thompson: I just haven’t done it. I’ve so far found no need to.
Seibeclass="underline" So you’re doing your stuff in your own sandbox? Do you mostly do your stuff in C?
Thompson: I write mostly in C. I do all my test stuff and toy stuff in C while Google is C++, strictly C++. It’s no big deal programming in C++, but I don’t like it. I resist it.
Seibeclass="underline" You were at AT&T with Bjarne Stroustrup. Were you involved at all in the development of C++?
Thompson: I’m gonna get in trouble.
Seibeclass="underline" That’s fine.
Thompson: I would try out the language as it was being developed and make comments on it. It was part of the work atmosphere there. And you’d write something and then the next day it wouldn’t work because the language changed. It was very unstable for a very long period of time. At some point I said, no, no more.