Crockford: Yeah, that’s great. We still got it wrong. We’ve got this greatthing where we can all get wired together and we can all get the messageout to each other, but it’s not working. It’s just a lot of noise at this point.

Seibel: And do you think that part of that solution of that problem will betechnical? Is there something programmers or system designers can do totweak the architecture that will help? Or is it a social problem?

Crockford: It may be that new social systems have to evolve on top of thisnew network infrastructure and it’s just immature at this point and that’swhy it’s not working. Maybe it just solves itself. I’m hoping that’s the case.But I think there may be more involved. Right now, the network does anextremely poor job of identity, does an extremely poor job of security, andthose are a necessary component, I think, of building robust social systems.So that aspect of the Web is still deficient and maybe that’s why it’s so noisystill.

Brendan Eich

Creator of JavaScript, perhaps the most widely used and most reviledprogramming language on the modern Web, Brendan Eich is now CTO of theMozilla Corporation, the subsidiary of the Mozilla Foundation responsible forcontinuing development of the Firefox browser.

With an appreciation of both elegant theory and good pragmatic engineering, Eichspent the early days of his career hacking network and kernel code at SiliconGraphics and MicroUnity. After MicroUnity, he moved to Netscape, where heworked on the Netscape browser and, under intense time pressure, inventedJavaScript.

In 1998, along with Jamie Zawinski, he was one of the leaders of the effort toconvince Netscape to open-source its browser, leading to the formation ofmozilla.org, where he was chief architect.

In recent years Eich has been involved in both high-level direction setting for theMozilla platform and in low-level hacking on a new JITing JavaScript virtualmachine called TraceMonkey. And, as he explains in this interview, he has alsobeen trying to find ways for the Mozilla project to “move the research needle,”bringing practical-minded academics into the Mozilla fold in order to bridge thegap between academic theory and industrial practice.

Other topics we touched on include why JavaScript had to look somewhat like Javabut not too much, why JavaScript does still need to grow as a language despite thefailure of the ECMAScript 4 project, and the need for more kinds of static codeanalysis.

Seibel: When did you learn to program?

Eich: I was a physics major as an undergraduate at Santa Clara in the late’70s, early ’80s. We used to go over to Stanford and hack into LOTS-A andLOTS-B, which were the two big timesharing DEC TOPS-20 systems andSanta Clara had a TOPS-20 system: a nice 36-bit processor from DEC, greatOS, wonderful macro assembler. C is “portable assembler” but the macroprocessing is terrible, whereas back then you had real macros for assemblyand you could do a lot of fairly structured programming if you weredisciplined about it. No type system, but C doesn’t have much of one tospeak of. And a rich set of system calls, system services, memory-mappedI/O, all the stuff that didn’t make it into Unix originally.

I was doing physics but I was starting to program more and I wasliking the math and computer-science classes I was taking, dealing withautomata theory and formal languages. At that point there was a researchrace to develop the best bottom-up parser generator, what yacc was doingand others would do. It was easy to see the formal purity translate intofairly clean code, which has almost always been the case with the front endof compiler construction. The back end back then was a mess of lore andheuristics, but I really liked the formal language theory and the theory ofregular languages and so on.

Seibel: And what languages and environments were you programmingin—presumably in physics you were doing Fortran?

Eich: That’s the funny thing. I was so pure physics, I wasn’t taking theengineering classes that would’ve had me carrying the deck and riskingspilling it and using the collator. I actually bypassed Fortran. Pascal was bigthen and we were getting into C. And assembly. So I was doing low-levelcoding, writing assembly hash tables and stuff like that. Which was good.You get better appreciation for different trade-offs. You can tell theprogrammers who’ve actually been down to bit-banging level versus theones who’ve been shielded all their lives.

I also was interested in C and Unix but we were only just getting into itwith this old DEC iron. We had the Portable C Compiler yacc-based messand we were just starting to generate code and play around with Unix utilityporting. Since physics wasn’t getting me summer jobs and I was doing a lotof hacking and being a lab assistant I ended up switching in my senior year tomath/computer science, and that’s what I got my undergraduate degree in.

Seibel: What was the first interesting program that you remember writing?

Eich: This is going to be embarrassing. There was a terrible graphicsterminal DEC made; it was like an evolution of VT100 because itunderstood the escape sequences, but it also had some pathetic color depthand some sort of early ’80s resolution. So I started writing game knockoffsfor it: Pac-Man, Donkey Kong. I wrote those games in Pascal and theyemitted escape sequences. But it was kind of hobby programming that grewand grew. I think that was the first nontrivial programming I did where I hadto think about modularity and protecting myself.

This was while I was a physics major, probably third year. Fourth year Ibecame math/computer science and I was starting to study formal languagesand write parser generators. So those were the kinds of programs I wrote:either games or serious nerd parser generator type programs. Then Istarted thinking about compilers and writing macro processor knock offs,like m4 knockoffs or CPP knockoffs. I remember when we got some versionof the Unix source and reading some of the really crufty C code. The JohnReiser C preprocessor—probably the original—was just an amazing mess. Itwas very efficient; it was using a global buffer and it was a huge pointer stew,and it would try to avoid copying. I thought, “There has to be a better wayto do this.”

So that’s how I ended up getting out of physics and into computer scienceand programming. I wasn’t really programming before that; it was all mathand science. My parents didn’t let me get an Apple II. I tried once. I didn’tbeg but I was saying, “I could learn a foreign language with this,” which was acomplete smoke screen. “No. You’ll probably waste time playing games.”And they were right. So they saved me from that fate.

Seibel: Other than providing more summer employment than physics, whatabout programming drew you in?

Eich: The connection between theory and practice, especially at the frontend of the compiler construction process, was attractive to me. Numericalmethods I didn’t get into too much. They’re less attractive because you endup dealing with all sorts of crazy trade-offs in representing real numbers asfinite precision floating-point numbers and that’s just hellish. It still bitesJavaScript users because we chose this hardware standard from the ’80s andit’s not always operating the way people expect.

Seibel: Because, like the Spanish Inquisition, no one really expects floatingpoint.

Eich: No one expects the rounding errors you get—powers of five aren’trepresentable well. They round badly in base-two. So dollars and cents,sums and differences, will get you strange long zeros with a nine at the endin JavaScript. There was a blog about this that blamed Safari and Mac fordoing math wrong and it’s IEEE double—it’s in everything, Java and C.


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