0:28
I was hired at Netscape in April, 1995.
Netscape had already launched its 1.0 Mosaic killer, if you remember Mosaic was
the the big, NCSA Mosaic was the big browser until Netscape took over.
So when I came to Netscape, they've been going for about a year.
I actually had an option to go into it at the beginning, I passed it up.
But I went in time to do what I was tempted to do which is
a programming language for HTML, for Web designers and
programmers to use embedded directly in the webpage.
Not something there was coming along at a time called Java, which was more of
a professional's language where you would write real code with typed declarations.
And you would have to write that code in a way that compiled.
I was writing something JavaScript that can be used by people who didn't know what
a compiler was.
They were just going to load it, it was like basic.
And that was really the pitch, that we would make two languages,
not one, analogous to Microsoft's Visual Basic for C++.
So JavaScript for Java.
Bill Joy of Sun actually liked that idea and agreed with it and he was the guy that
signed the trademark license by which what I had created became JavaScript.
The name is a total lie, it's not really related to Java so
much as to a common ancestor, C Instant Text.
To the extent that we made it easy to use, and something you can copy, paste,
program, or start small from scripts and grow to programs.
JavaScript has succeeded massively, it was also an incredible rush job so
there were mistakes in it.
And, something that I think it's important about it is that
it I knew there would be mistakes and there would be gaps.
So I made it very malleable as a language.
And that has enabled Web developers to make it be what they want it to be,
to project their own style of not just API but almost language pattern on it.
And create their own innovation networks to use von Hippel's phrase,
innovation toolkits on top of it.
So it's not a language that tries to restrict you to one paradigm.
It's a multi-paradigm language.
>> I mean there's all these things where our language comes out and
immediately trips and falls and you have to sort of, it's okay, that's fine.
But there wasn't really a trip and fall in JavaScript, why?
>> So, you could say there hasn't been a version two and
that's true because I've tried to work on what might be a big version two,
that was called the fourth edition, and that failed.
There has been evolution.
The Web is all about evolution.
People don't quite see this while you're in the midst of it because it's
microevolution.
But webpages from the '90s don't all render properly these days.
They don't all work right, and a lot of them are lost and
only available to the webarchives.org.
JavaScript had enough at the beginning, enough good parts,
to use Crockford's phrase, or enough genetic material from other languages,
first class functions, prototype inheritance from self.
The inheritance of first class functions from scheme is really
kind of a fraud because scheme is different in many ways.
And I couldn't make those differences manifest.
I couldn't do the scheme thing in JavaScript.
I was under these marching orders to make it look like Java.
I had ten days to prototype it.
So scheme was more of a spiritual than a actual influence.
But first class functions are very powerful, and
they fit within event handling sort of programming model.
I was inspired by Atkinson's HyperCard, so that's why you see onclick in JavaScript.
HyperCard had this pattern prevention list called on page down or whatever.
So JavaScript had enough good at the beginning to survive.
Now if you think back though to the mid-90s, JavaScript was
cursed because it was mainly used for annoyances like little scrolling
messages in the status bar at the bottom of your browser or flashing images.
Or things that pop up windows massively.
We could have put in controls, as we should have.
Eventually, browsers, Firefox kind of championed this,
led this automatic suppression of annoyances that made it all much better.
And with Moore's law compounding and with JavaScript getting some evolutionary
improvements in the standards process, it really became really quite fast enough and
good enough in 2004 and '05 to begin the Web 2.0 revolution.
That was, I think, tied in with Firefox's retaking market share from IE and
developers realizing there was a client side to the programming stack that could
be expressive and powerful.
And could be fast enough, thanks to faster computers, mainly.
>> You must have had some training, some kind of-
>> I've done a lot of-
>> Set experiences that you kind of got to
the point where you could pull from scheme and-
>> Mm-hm, I had implemented.
I was a sort of a language buff when I first entered computer science.
I was a math, physics major originally and ended up math,
computer science when I finally got my undergraduate degree.
So I was programming formal language theory applied to recognizing languages,
lexical analysis, parsers, automatically constructed parsers from grammars.
I loved that stuff because it was all very pretty and clean theoretically.
And it still is, it hasn't changed a lot.
There's been only one or
two innovations since my time in university in the early '80s.
So what that gave me was the ability to quickly
knock out sort of a language interpreter.
I could do the parser and the scanner,
I could generate bytecode because Netscape wanted to do a server-side embedding.
And JavaScript, even though it could have been TreeWalker,
something that interpreted parsers, I made a bytecode for it.
And it was an internal bytecode, not the Java bytecode that's become a handicap for
Java, I think.
6:02
And I knocked all that out really quickly because I'd done it before.
I'd done it at Silicon Graphics to build sort of network monitoring tools to
capture packets based on expressions over fields of the various protocol headers.
I'd done it for fun just to make my own languages and
finally I got to do it really quickly.
The speed was an issue for me.
It was partly, we were all feeling like Microsoft was going to come after Netscape
because they had tried to buy Netscape in late '94 for too little money.
I had heard about this, it was before my time at Netscape.
But we also were in a weird game theory with respect to Java,
because even in Netscape, some people thought, well, if we have Java,
do we really need a second language?
You didn't see the benefit of the Visual Basic companion language for
a much larger cohort of programmers who are amateurs, designers, beginners.
To write Java is to write C++ for
the Microsoft platform that they took a lot of education.
Greater pay was a higher price proposition to get people gluing components together
and designing pages and filling gaps using JavaScript as they did with Basic and
Visual Basic.
And Microsoft Windows was cheaper and wider spread.
It also enabled this user innovation toolkit approach to use von
Hippel's phrase again.
Because JavaScript is malleable, because there are so many web designers,
you would see different schools of thought on how to use it emerge.
And this has become quite clear over the last ten years with various
JavaScript libraries.
And I think that's actually an advantage, as I said earlier,
to JavaScript, that we're not telling you here's the one way to write it.
>> Here's the one true object oriented paradigm,
here's the only way you should ever make a reusable abstraction.
>> It's not unmixed, right, it's hard for beginners.
People reinvent certain wheels and make mistakes doing it, or
don't like having to acquire a library.
But you see jQuery, a very popular library,
because it gives people this very sweet query and do paradigm.
And again, it's not mandatory with JavaScript, but
a lot of people learn that and they think that is JavaScript.
They think jQuery is a language or
they think jQuery is the tail that wags the dog.
jQuery is great and John Resig used to work with us in Mozilla, but there are so
many good libraries out there now.
They're actually shrinking, and becoming more compositional, which is a good trend.
So JavaScript by being malleable, sort of fostering user innovation,
I think has plenty of unique role.
If I had done something more rigid,
I think the odds are pretty good it would have failed.
>> I just can't imagine how you would have escaped from
the object-oriented pattern of C++.
>> Partly I had to because if I had done classes in JavaScript back in those
ten days in May in 1995, I think I would have been told this is too much like Java,
you're competing with Java.
Somebody at Sun would have yelled at Bill Joy more than they did and
it might have killed the deal.
So I was definitely not only under time constraints but under marketing orders to
make it look like Java but don't make it too big for its breeches.
It's just this sort of silly little brother language, right, sidekick to Java.
>> But then you put in primitives.
>> I snuck some stuff in, yeah.
>> You put some primitives, like closures and
all those other things that is like you can build what you want.
>> Yes and that kind of went under the radar for a lot of people.
And it wasn't all even there in a good working order in the first release.
But over the next few years, it became not only well known,
I would say more standardized than well known.
Over the next ten years, it became evangelized, like Crockford's the exponent
of the closure pattern and the good uses you can make with closures.
So people find the malleability and the expressiveness and
the power compelling enough that some people actually resist any version two.
They say, I don't want you to add cliches or common special forms for
9:38
patterns that I'm more happy writing myself, or acquiring as a library myself.
>> You've created an abstraction that implementors can do
crazy thing with, right.
And people can rethink what the interpreter is really supposed to do.
>> They can. >> And they can just say okay,
here comes V8.
>> And it puts- >> And we've thought about a lot of things
differently, right?
>> That's right, optimizations that haven't been tried.
I knew about this optimization because I studied Smalltalk itself.
But nobody gotten the time and the money, Google was maybe first.
They were other efforts going in parallel and Apple and
Mozilla have kept up as best they can.
But V8 gets a lot of credit for pushing this forward.
It wasn't quite as first on the scene as they claim because we were all
coming together in 2008.
But it has been very helpful, it has shown people what can be done.
What's interesting to me is that you then go and
put different more intensive workloads on the language.
And you see there's a new V8 that should come out of somewhere.
It may not have come out of Google because they may have tired of optimizing
JavaScript.
In fact, I believe Dart is a response to that by the principles who did V8.
They want to do a language where they don't have to worry about all this crazy
compatibility.
10:43
May not succeed and it also doesn't give JavaScript the next level of performance.
But I believe that level is there, and it's still improving in performance much
more dramatically than a language like Java, where the gains are a percent or
a fraction of a percent on the standard benchmarks.
But a lot of HTML5 development now, quote unquote, HTML5, JavaScript, CSS,
Web APIs, beyond what's an HTML5, is taking off.
You're seeing Zynga doing HTML5-only games.
It's really coming faster than some thought,
and I talked to venture capitalist Fred Wilson of Union Square, New York.
He said, yeah, it's here.
He thought it would take years, we've turned that corner.
And so you call it HTML5, what it really means is that it's the Web stack.
It's the same stack you use to write webpages and host the web apps.
You can write apps that run in your device,
apps that are maybe hosted maybe offline.
Maybe the line is blurred so that you can associate them with the URL.
But you can also take them on the plane without any fear that you're going to lose
anything by disconnecting from the Internet.
[MUSIC]