Brendan Eich
145
Because, like Crock and others, I think you do want to simplify and I do like
the languages designers who take fewer primitives and see how far they can
go. I think there’s been kind of a Stockholm syndrome with JavaScript: “Oh,
it only does what it does because Microsoft stopped letting it improve, so
why should we want better syntax; it’s actually a virtue to go lambda-code
everything.” But that Stockholm syndrome aside, and Microsoft stagnating
the Web aside, language design can do well to take a kernel idea or two and
push them hard.
Seibel: Were you aware of NewtonScript at all?
Eich: Only after the fact did someone point it out to me and I realized,
“Hey, they’ve got something like our scope chain in their parent link and
our single prototype.” I think it was convergent evolution based on Self.
And the DOM event handlers—part of the influence there was HyperTalk
and Atkinson’s HyperCard. So I was looking not only at Self and Scheme,
but there were these onFoo event handlers in HyperTalk, and that is what I
did for the DOM onClick and so on.
One more positive influence, and this is kind of embarrassing, was awk. I
mean, I was an old Unix hacker and Perl was out, but I was still using awk
for various chores. And I could’ve called these first-class functions anything,
but I called them “function” mainly because of awk. An eight-letter
keyword—it’s kind of heavy, but there it is.
Seibel: At least it wasn’t “lambda”—JavaScript would’ve been doomed
from the start. Were there any languages that negatively influenced
JavaScript, in the sense of, “I don’t want to do that”?
Eich: It was such a rush job that I wasn’t, like, worried about, “Oh, I can’t
make it into Ada or Common Lisp.” Java was in some ways a negative
influence. I both had to make it look like Java and not let in those crazy
things like having a distinction between primitive types and objects. Also, I
didn’t want to have anything classy. So I swerved from that and it caused me
to look at Self and do prototypes.
Seibel: Did you ever consider making a language more closely related to
Java—take Java and make some kind of simple subset; get rid of the
primitive types and other needless complexities?