Seibel: How much of your own programming did you do for fun versusconsciously doing things to learn particular techniques?

Cosell: Mostly I viewed computer programming as a means to get neatthings done and I learned how to program in order to make things happen.There were things that seemed broken to me that I could fix. I thought itwould be fun to do some Lisp programming not because I wanted to learnLisp but because some of my friends across the bridge were big Lisp guysand it was all a little mysterious to me. So I wrote some programs and thatjust seemed like the natural thing for me to do as opposed to sitting at DanMurphy’s knee and having him give me lectures on CONS and CDR andCAR.

Seibel: Are there areas in formal computer science that you think areparticularly useful for people who ultimately want to work as programmers?

Cosell: There are a bunch of things. I know a lot of schools do a terriblejob of it, but I think getting a good course in object-oriented programmingin its abstract form. One of the things I fought about with some folks at alocal college here was teaching object-oriented programming using C++. Iasked how they make sure their students understand the distinctionsbetween the philosophical concept of object-oriented programming versusthe idiosyncrasies and weirdnesses of C++’s implementation of it.

One other thing I think schools can do is the stuff that’s in Knuth. I’msurrounded by people who think linked lists are magic. They don’t knowanything about the 83 different kinds of trees and why some are better thanothers. They don’t understand about garbage collection. They don’tunderstand about structures and things.

Then the next volume: sorting and searching. If the programming languagedidn’t have a sort function, they wouldn’t have a clue about different typesof sorting, or how to search for things, when you should build indexes, whatit means that the database we’re using stores things in a B-tree. I think agood course would give them background not in, how do you write a linkedlist in C—that’s a craftsman thing—but what do linked lists do in an abstractsense?

Seibel: Perhaps the most famous project you worked on was the beginningof the ARPANET, when you, Will Crowther, and Dave Walden wrote thesoftware for the original ARPANET IMPs. How did that come about?

Cosell: In Frank Heart’s group, our division, Frank viewed all of hisprogrammer guys as this basic stable. He picked and chose how to movepeople from project to project. When my projects ran out, Frank wouldfigure out what I should work on next. As opposed to the real consultingguys who would start flying to Washington and writing proposals; I wasspared having to do that. Somehow, Frank had decided that I was to be thethird guy on the IMP project.

I was working on another project in the fall of ’68 when Dave and Willy andthose guys had started. I think the contract had been awarded but wasn’tgoing to start until January. When I joined the project, not much was done. Ithink they had scraped out some of the code, but nothing was really cyclingyet. When I came on board and Dave and Willy had started blocking outhow the system was going to be organized and had taken hunks that theywere starting to write. I just fit in and claimed a piece or two for myself. Weall had different skills but we were all going to know how every line of codeworked for the thing because it wasn’t that big a program. Complicated, butnot that big.

And I know they couldn’t have gotten very much done when I joinedbecause they were still doing offline assemblies, which involved taking apaper tape into the Honeywell room where there was a 516 and runningpaper tapes through, making an assembly listing by having it punch an entirebox of paper tape, which they would then have to carry to another machinebecause there was no line printer on the Honeywell machine to make anassembly listing. It was really pretty cumbersome doing the softwaremanagement for that. One of the first concrete things I did on the projectwas I wrote a cross assembler for our PDP-1.

Then on the PDP-1 we could edit the files, assemble the files, makeassembly listings of the files, run TECO macros over things. The only thingthat got punched out was the comparatively small paper tape of the binaryexecutable program, which would then go into the Honeywell machine.

Seibel: Was that the biggest challenge of writing the IMP software: makingit go fast?

Cosell: Oh, that’s interesting. Well, let’s see. We didn’t think very muchabout how big it was because the idea was that the system was going tohave to have a lot of space for buffering. And the code wasn’t going to bethat big. And if the code was, say, ten percent larger than it could be if yousqueezed it down, that would just mean that there would be a few fewerbuffers. So we weren’t quite so much worried about counting how manyinstructions everything took.

Seibel: In terms of how much space it would take.

Cosell: Right. How much space. But we were concerned with speed,whether we were going to keep up with the bandwidth. And how do youorganize a system so that it degrades gracefully and, in particular, degradesin a way that it can dig itself out of a hole as opposed to just collapsing anddying?

The second thing was just making the system work. There was a lot ofuntried, untested stuff. Were the protocols going to work? Will had comeup with some ideas for the routing algorithm—was that going to work?There were still a lot of underlying questions. A question about congestioncontrol. Did we know for sure that if everybody in the world sent packetsto one poor guy that we would actually refuse the packets in the right orderand dig himself out?

Seibel: So that was basically because nobody had ever tried to solve thisproblem before.

Cosell: Exactly right. It was a research project at that point—a lot oftheory. A lot of people had written dissertations. A lot of people thoughtthey knew what was going on. At that point, the rubber had to meet theroad. We had to actually see whether the queuing theory was going towork, whether the routing algorithm could oscillate.

The third big challenge was simply how do you debug the thing. All of asudden, you can’t talk to Cincinnati, Ohio. What went wrong? How do youfigure it out? You call Cincinnati, Ohio, and you get a sleepy night watchmanat 3:00 in the morning walking up to this little blinking box in the corner.What does he look at? What do you do? And even if you get the systemback up, what went wrong? How do you fix it? Remember, I was a bigthings-don’t-crash, things-are-going to-keep-working guy.

I know that one of the things that impressed Will was there was some bugthat they could not find and I found it. It turns out it was a bug in thehandling of some protocol for the modems and it was sending the wrongpacket at the wrong time. I put together a series of patches so that I couldput a marker in a packet and when it saw that particular packet, it installed apatch on the system that looked for this other thing happening and as soonas it saw it, it stopped the system. Then once it stopped the system, wecould use debuggers to figure out what was going on. Once I had done that,it took about two minutes to find the bug because the offending packet wasstill in memory; it hadn’t been written over.

I don’t remember the exact problem, but it was one of these problems thatwas not fatal. There was a bad pointer corrupting memory and thecorruption wasn’t causing any trouble, but thousands and thousands ofmachine cycles later, the program crashed because some data structure wascorrupt. But it turns out the data structure was used all the time, so wecouldn’t put in code that says, “Stop when it changes.” So I thought about itfor a while and eventually I put in this two- or three-stage patch that whenthis first thing happened, it enabled another patch that went through adifferent part of the code. When that happened, it enabled another patch toput in another thing. And then when it noticed something bad happening, itfroze the system. I managed to figure how to delay it until the right time bydoing a dynamic patching hack where one path through the code waspatched dynamically to another piece of the code. And I was lucky because Iguessed the right thing and we immediately found the problem.


Перейти на страницу:
Изменить размер шрифта: