5 ms·
Ask HN: Why did JavaScript win the browser?
I'm trying to understand why Javascript won the browser.
There were tens of other languages one could have added in a browser, and yet this particular one, which wasn't even an established language but a new one, ended up being implemented in browsers.
How did that happen? If you were implementing Netscape or IE back then, what was going through your mind when you sat down implementing version one?
- timetraveller 12y agoFirstly, JavaScript was specifically created (tailored) for browsers. Secondly, despite all the negative rants and how awful it is, JavaScript is very flexible and forgiving which is a good thing for web pages. Imagine if you get a parser error message preventing you from viewing every page that has a little error/bug/incompatible code with your JS version, etc.
- wtbob 12y agoI think that if one did get such messages then it'd be better, since folks would have an incentive to fix their pages, of not rely on JavaScript (which would be even better … I'm tired of blood which won't display text without me having to grant them acres to run coffee on my system.
- davidddavidson 12y ago"I'm tired of blood which won't display text without me having to grant them acres to run coffee on my system." What? Many autocorrect fails right here...
- wtbob 12y agoArgh. Blogs/access/code I blame swipe typing.
- TheLem 12y agoI think the best answer to your question is this video : https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death... Title : THE BIRTH & DEATH OF JAVASCRIPT By : Gary Bernhardt From : PyCon 2014
- malisper 12y agoAccording to Wikipedia[0], Brendan Eich was originally supposed to put Scheme in the Netscape web browser. Instead he decided to create Javascript and used that instead. [0] http://en.wikipedia.org/wiki/Brendan_Eich#Netscape_and_JavaScript http://en.wikipedia.org/wiki/Brendan_Eich#Netscape_and_JavaS...
- uhsnamih 12y agoWhat prevents adding other languages to the web browser even now?
- icebraining 12y agoGetting people to agree on which should be added. Adding new languages is only useful if they're widely supported by browsers. Google is trying with Dart, they already have a fork of Chromium with a VM for it[1], but it still needs to be compiled to JS to support other browsers, and to many developers that loses its appeal. [1] https://www.dartlang.org/tools/dartium/ https://www.dartlang.org/tools/dartium/
- BrendanEich 12y agoAnd they need a way to avoid cyclic leaks among Dart and JS via the DOM. That adds a tax in the form of write barrier overhead, which caused Apple to reject the WebKit patch. https://lists.webkit.org/pipermail/webkit-dev/2011-December/018811.html https://lists.webkit.org/pipermail/webkit-dev/2011-December/...
- curtis17 12y agoThe most interesting way forward re languages/runtimes looks like something Brendan mentioned here: http://javascriptjabber.com/124-jsj-the-origin-of-javascript-with-brendan-eich/ http://javascriptjabber.com/124-jsj-the-origin-of-javascript... > At some point, Sweet.js ties the knot and people can write hygienic macros and extend the language.... And it’s all based on a common set of primitives and that’s the important thing. You can reason about the primitives. You can compose them. They’re compositional. They compose orthogonally. That’s the goal here. JavaScript has a lot of warts in it, but if you weed those out or deprecate them you end up with stuff that is compositional. And that’s where I think we’re heading.
- JaviScript 12y agoJavaScript was the first programing language that runs in a browser. Historically this was the main reason, JS was developed for the most used browser in 1995: Netscape. Also this implementation become an standard: ECMAScript. Be the first, the most used and became a well-defined standard are requisites to success. Microsoft tried to do their own language for browsers called JScript (based in JavaScript but really incompatible with the ECMAScript specification). JScript was important but the people preferred the compatibility between browsers and not the features on JScript, so they supported more the JavaScript implementation. With this scenario, JavaScript become the unique supported programing language in the browsers. Other companies tried to create the next generation of browser-languages like Google with Dart but JavaScript is so expanded that it's practically impossible to be substituted in short-term.
- izolate 12y agoDart has replaced Node.js for me, not JavaScript.
- nhebb 12y agoMicrosoft also pushed VBScript in the browser. They've finally dropped support for it in IE 11: http://msdn.microsoft.com/en-us/library/ie/dn384057%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/ie/dn384057%28v=vs.8...
- BrendanEich 12y agoI've written and spoken a lot about the early days. Just one example: http://chimera.labs.oreilly.com/books/1234000001808/pr02.html http://chimera.labs.oreilly.com/books/1234000001808/pr02.htm... See also my blog and quora.com. And HN: https://news.ycombinator.com/item?id=1905155 https://news.ycombinator.com/item?id=1905155
- kadumel 12y agoBrendan I respect all of your work on creating a framework that gives at least thousands of people a job every day but I don't quite understand this article and it's purpose. I agree that you were under duress when creating but what are we getting at here?
- BrendanEich 12y agoThe question was how JS "won" the browser. The answer is that Netscape (with Bill Joy at Sun) fixed the race and ran it in 10 days. Way too little time to use an existing language and bend it to "look like Java". Did you read the last link, the HN comment? Update: http://javascriptjabber.com/124-jsj-the-origin-of-javascript-with-brendan-eich/ http://javascriptjabber.com/124-jsj-the-origin-of-javascript... has more detail. The point of all this isn't subtle. MS was coming after Netscape, copying and injecting stuff like VBScript. JS was a rush job because of this. If it had waited till Netscape 3 the odds of a VBScript mandatory single scripting language for the Web would've been high. Netscape 4 was way too late. Only by going out in Netscape 2 did JS preempt that VBScript dystopia. Only by looking like Java did it get management support. Only by being its own language did it happen in ten days. /be
- miketaylr 12y agoHave a quick view-source at http://portal.mj.gov.br/EstrangeiroWEB/destaques.asp http://portal.mj.gov.br/EstrangeiroWEB/destaques.asp for those who can't imagine what VBScript dystopia looks like.
- 12y ago