Bonus- Brendan Eich - Inventing Javascript
دوره: Python Data Structures / فصل: Chapter Nine- Dictionaries / درس 6سرفصل های مهم
Bonus- Brendan Eich - Inventing Javascript
توضیح مختصر
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 popped up windows massively. 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. I'd done it at Silicon Graphics to build sort of network monitoring tools to capture packets based on expressions that were fields of the various protocol headers.
- زمان مطالعه 0 دقیقه
- سطح خیلی سخت
دانلود اپلیکیشن «زوم»
فایل ویدیویی
برای دسترسی به این محتوا بایستی اپلیکیشن زبانشناس را نصب کنید.
ترجمهی درس
متن انگلیسی درس
I was hired at Netscape in April, 1995. Netscape had already launched its 1.0 Mosaic killer. If you remember, Mosaic was the big, I would say Mosaic was the big browser until Netscape took over, so when I came to Netscape, they’d been going for about a year.
I actually had an option to go on to it at the beginning and I passed it up, but I went in 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 web page.
Not something that was like coming along at the time called Java which was more of a professional’s language where you would write real code with type declarations and you would have to write that code in a way that compiled.
I was writing something, JavaScript, that could 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 in syntax. And, and, to the extent that we made it easy to use and something you could 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 is 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 Eric von Hippel’s phrase, or 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 a language comes out and immediately trips and falls and you have to sort of, it’s okay Mm-hm. the second time, Mm-hm.
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 web pages 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 through webarchive.org.
JavaScript had enough at the beginning, enough good parts to use Crockford’s phrase, or enough genetic material from other languages.
You know, first-class functions, prototypal 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. That 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 with an event handling sort of programming model.
I was inspired by Atkinson’s Hypercard. So that’s why you see on Click in Javascript. Hypercard had this pattern for event handlers called on, you know, on Page, the downer, 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 popped up windows massively.
We could have put in controls for those, and 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 became really quite fast enough and good enough in 2004 and 5, to beget 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 kind of training. Oh, I’d done a lot of. Some kind of set of experiences that got to the point where you could pull from Scheme, and, and.
Mm-hm.
I had implemented, I was sort of a language buff when I first entered computer science. I was a math/physics major originally and ended up math and computer science when I finally got my undergraduate degree.
So I, 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, it still is. It hasn’t changed a lot.
There’s been only one or two innovations since my time at the university in the early 80s. So what, what that gave me was the ability to quickly knock out, you know, sort of a, 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 a treewalk or something that interpreted parse trees, 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. 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 that were 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, 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’d heard about this, it was before my time at Netscape. But we also were in a weird game period with respect to Java. Because even at Netscape, some people thought, well, if we have Java, do we really need a second language?
They didn’t see the benefit of the Visual Basic companion language for a much larger cohort of programmers or amateurs, designers, beginners.
To, to write Java, as to write C++ for the Microsoft platform today, took a lot of education, greater pay. It was a higher-priced 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’s Windows, was cheaper and wider spread.
It also enabled this user innovation toolkit approach, to use Von Hippel’s phrase again.
Because JavaScript was malleable, because there were 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 past ten years with the 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 extraction.
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, and again it’s not mandatory with JavaScript, but a lot of people learn that and they think that it is Javascript.
They think jQuery is a language, or they think, you know, jQuery is the tail that wagged the dog. jQuery is great, and Don Resnick used to work with us at Mozilla.
And, 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 and sort of fostering user innovation, I think has played a unique role.
If I had done something more rigid, I think the odds are pretty good it would’ve failed. I, I just can’t imagine how you would have escaped from the object-oriented pattern of C++.
Partly I had to, because if I’d 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.
You know, somebody at Sun would’ve yelled at Bill Joy more than they did. And it might have killed the deal.
So I was definitely not only under a time constraint, but also under marching orders. Make it look like Java, but don’t make it too big for its britches.
It’s just this sort of silly little brother language, right? A sidekick to Java. But then you, you put in some primitives.
I snuck some stuff in, yeah. You put some primitives, you know, like closures and all those other things that, that is like you can build what you want.
Yes, and, and that kind of went under the radar for a lot of people, and it wasn’t all even there, you know, in 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 a big exponent of the closure pattern and the good uses you can make of 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 patterns that I’m more happy writing myself or acquiring as a library myself.
You, you’ve created an abstraction that implementers can do crazy things with, right?
Mm-hm.
And people can rethink what the interpreter’s really supposed to do. They can. And they can just say, okay, here comes V8. And it thought about a lot of things differently.
And it puts, that’s right. Right. Optimizations that haven’t been tried, I would, I knew about these optimizations because I had studied Smalltalk itself. But nobody had gotten the time and the money. Google was maybe first.
There were other efforts going on in parallel, and Apple and Mozilla have kept up as best they can.
But V8 deserves a lot of credit for pushing this forward. It wasn’t quite as first on the scene as, as they claim, because it was all coming together in 2008.
But it has been very helpful and 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. And it may not come out of Google because they may have tired of optimizing JavaScript.
In fact I believe Dart is a response to that by the principals who did V8.
They want to do a language where they don’t want have to worry about all this crazy compatibility. It 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 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 in HTML5, is taking off.
You’re seeing like Zynga doing HTML5-only games. It’s really coming faster than some thought. And I talked to venture capitalist Fred Wilson of Union Square in New York he said yeah, it’s, it’s here.
He thought it would take years. It’s, we’ve turned that corner.
And so you call it HTML5, what it really means is it’s the web stack. It’s the same stack you use to write web pages and host the web apps.
You can write apps that run in your device, apps that are maybe hosted maybe offline, and maybe the line is blurred so that you can associate them with a 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.
مشارکت کنندگان در این صفحه
تا کنون فردی در بازسازی این صفحه مشارکت نداشته است.
🖊 شما نیز میتوانید برای مشارکت در ترجمهی این صفحه یا اصلاح متن انگلیسی، به این لینک مراجعه بفرمایید.