Seibel: Other than the possibility of implementing it at all, how do youdecide whether your interfaces are good?

Steele: I usually think about generality and orthogonality. Conformance toaccepted ways of doing things. For example, you don’t put the divisorbefore the dividend unless there’s a really good reason for doing so becausein mathematics we’re used to doing it the other way around. So you thinkabout conventional ways of doing things.

I’ve done enough designs that I think about ways I’ve done it before andwhether they were good or bad. I’m also designing relative to some relatedthing that I’ve already designed before. So, for example, while looking at thespecifications for numeric functions in Java, I’d already done numericfunctions for Common Lisp. And I’d documented numeric functions for C. Iknew some of the implementation pitfalls and some of the specificationpitfalls for those things. I spent a lot of time worrying about edge cases.

That’s something I learned from Trenchard More and his array theory forAPL. His contention was that if you took care of the edge cases then thestuff in the middle usually took care of itself. Well, he didn’t say it that way; Iguess that’s the conclusion I draw from him.

To turn it around, you want to design the specification of what’s in themiddle in such a way that it naturally is also correct on the boundaries,rather than treating boundaries as special cases.

Seibel: During your time at MIT you were somehow involved in the birthof Emacs. But the early history of Emacs is a bit hazy. What is your versionof the story?

Steele: My version of the story was that I was playing standards guy. Whathad happened was there was this display mode that turned TECO intosomething like a WYSIWYG editor. On our 24x80 screens, 21 lines ofwhat was in the buffer would be shown on the screen and the bottom 3lines were still a TECO command line. You’d be typing in these TECOcommands and only when you hit the double almode would they then beexecuted. Then there was the real-time edit mode, where it was suggestedthat a TECO command throw you in this other mode whereby instead ofwaiting for you to type the double altmode, TECO would react immediatelyto single character commands. If you type one character, it would do thecommand. You type another character, it would do the command. Andmost printing characters were self-inserting. Then the control characterswere used to move forward, back, up, and down. It was a very, veryprimitive—it looked like a very primitive version of Emacs.

Then came the breakthrough. The suggestion was, we have this idea oftaking a character and looking it up in a table and executing TECOcommands. Why don’t we apply that to real-time edit mode? So that everycharacter you can type is used as a lookup character in this table. And thedefault table says, printing characters are self-inserting and controlcharacters do these things. But let’s just make it programmable and seewhat happens. And what immediately happened was four or five differentbright people around MIT had their own ideas about what to do with that.Within just a few months there were five completely incompatible GUIinterfaces to TECO.

Seibel: So they were just customizing, essentially, the key-bindings?

Steele: That’s right. And they each had their own ideas about what shouldbe concise because you do it most often and what you can afford to belonger. So one guy, for example, was really concerned about typing in Lispcode and began to experiment with finding balanced parenthesizedexpressions. And another guy was more interested in text, so he wasinterested in commands that would move over words and convert betweenuppercase and lowercase and capitalize them. And that’s where thosecommands in Emacs came from.

Different people had different ideas about how the key-bindings ought to beorganized. As a systems-support guy for Lisp, I was often called to people’sterminals and asked to help them. And I fairly quickly noticed that I couldn’tsit down at their TECOs and help them modify their programs because I’dbe faced with a set of key-bindings and I had no idea what they were goingto do.

Seibel: Was one of these guys Richard Stallman?

Steele: No, Stallman was the implementer and supporter of TECO. And heprovided the built-in real-time edit mode feature, although I think CarlMikkelsen had worked on the early version of it. He provided the keybindingsfeature that made all of this possible.

Anyway, there were something like four different macro packages and theywere incompatible, and I decided to play standards guy, or communityreconciliation guy. I saw something that had been lost in our community,which was the ability to easily help each other at our terminals. I said, “OK,we’ve had some experimentation; we’ve seen a bunch of ideas. What if wecould agree on a common set of key-bindings and draw the best ideas fromeach of these things?”

I literally had a pad of paper and ran around the building, talking to theseguys, visiting each of them several times, and tried to get some kind ofconsensus. I was trying to get consensus on what the content ought to beand then I drew on their designs and tried to organize the actual choice ofkey-bindings so as to make them a little more regular and a little moremnemonic. And not being a human-factors guy at all, I didn’t think at allabout convenience for touch typists. I was principally concerned withmnemonic value. And so that’s why Meta-C and Meta-L and Meta-U standfor capitalize and lowercase and uppercase.

Seibel: Which is sort of ironic given the way the commands move out ofyour brain and into your fingers. I’m sure you have experienced thephenomenon of having someone ask you what is the key-binding forsomething that you use a thousand times a day, and you can’t say.

Steele: Actually my wife had that experience. Maybe one of the reasons Iwas less aware of it is that I’m not a particularly good touch typist. But she’dbeen away from Emacs for 20 years and then I made one available on herMacintosh. And she sat down, typed in some stuff, and then said, “How do Isave this? I forget how to save a file.” And then she realized her fingers haddone it and she didn’t know what she’d typed. So she did it again andwatched her fingers and said, “Oh yes, Control-X Control-S.” But sheliterally couldn’t remember what the commands were.

Seibel: So you made this standard set of key-bindings. How did that goover? Were people happy with it?

Steele: Well, people worked through it. Then I then sat down andproceeded to begin an implementation of it. And we had another idea thatcame into the mix at the same time and it was the idea that you could makeTECO macros run a lot faster if you squeezed out the spaces and deleted allthe comments. The way the TECO interpreter worked, interpreting onecharacter at a time, when you encountered a comment it had to spend thetime skipping over that comment. So we had this idea of this very primitiveTECO compiler that was mostly just squeezing out the white space and thecomments and doing a few other minor things to put it in a form that wouldrun a little bit faster.

So I began in an initial way to try to construct a version of this macrocompressor, which I think was actually based on an earlier idea that Moonhad had. I don’t think I originated that idea. I began to think about how toorganize the initial dispatch and organize some of the first few routinesborrowing on the existing implementations of other macro packages—I wastrying to synthesize them. And about that point Stallman came along andsaid, “What are you doing? This looks interesting.” He immediately jumpedin and he could implement ten times as fast as I could, partly because heknew TECO inside out.


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