News for hackers. Stuff that matters.
Re:Ask HN: Why is everything in JavaScript changing so fast? by roblabla on Friday October 21, 2016 @10:12AM (#12760564)
Explain what the coincidence was ? There are alternatives everywhere (ActiveX, flash, java, visual basic IIRC). And yet here we are, with JS.

I believe JS came here because it actually is the best language we have had in the web. It's so easy to throw shit arround, but let's be honest with ourselves, this isn't purely out of luck.

Re:Ask HN: Why is everything in JavaScript changing so fast? by niftich on Friday October 21, 2016 @10:56AM (#12760949)
JS won because it was the only thing that every browser supported from the very beginning, and the various differences in implementation (of which there were many) were eventually shimmable by jQuery and other AJAX frameworks. Everything else was either some alternative only supported by one of the vendors (VBScript, Dart), or a full-blown plugin that had a different model of interaction with the webpage (Java, Shockwave, Flash, Silverlight).

It's pretty much the textbook instance of a compromise between vendors of competing interests to further the common web. Despite this, it took a really, really long time -- almost ten years -- for JS to receive additional browser-implemented APIs that brought that platform's capability to what we know today and comparable to that of what we had with plugins -- and still, not every vendor supports every spec yet, making this "open web" no less subject to vendor pressures, despite being 'open' and 'neutral' [1].

[1] https://news.ycombinator.com/item?id=12259827#12259940

Re:Ask HN: Why is everything in JavaScript changing so fast? by qznc on Friday October 21, 2016 @10:49AM (#12760887)
JS is the only language integrated into the browser and the DOM. Netscape rejected other languages (Python, Perl, TCL) because of syntax, so Brendan Eich disguised Scheme into Java syntax and hacked up a prototype in 10 days.

Today, Javascript is sooo interwoven with the DOM in browsers that it is near impossible to separate them. Google planned to do this for Dart, but gave up. If they had done this and other browser vendors had followed, adding a third and forth and more languages would have been (relatively) easy, because the abstraction were in place. Then we would have seen a healthy competition.

There is asm.js. Maybe we will get a "web bytecode" at some point, but that will easily take a decade and more. The pressure is increasing, because our CPUs don't get exponentially more powerful anymore. And delivering apps via the web is still going strong.

Re:Ask HN: Why is everything in JavaScript changing so fast? by BrendanEich on Sunday October 23, 2016 @11:09AM (#12773857)
1. WebKit rejected adding barriers to support multiple garbage collectors and a super-GC to collect cycles, required by Dart or any 2nd VM. See https://lists.webkit.org/pipermail/webkit-dev/2011-December/... where Fil Pizlo of Apple cites 5% throughput regression.

Dart was never going to make it, and adding 3 or 4 VMs with their own GCs is even less plausible.

2. See https://github.com/WebAssembly for progress on what asm.js showed was possible: a 2nd, initially co-expressive with asm.js, eventually more expressive, binary syntax for the Web. It's happening now, this year and probably shipping experimentally in 1Q2017.

Writing "easily take a decade" out of ignorance just says to me you didn't even bother to use google!

Re:Ask HN: Why is everything in JavaScript changing so fast? by BrendanEich on Tuesday November 01, 2016 @02:14AM (#12843781)
Re:Ask HN: Why is everything in JavaScript changing so fast? by mook on Friday October 21, 2016 @12:27PM (#12761770)
There were noon-JS languages on the web, though; in particular, VBScript was a thing in the (at the time) most popular browser. I understand that at one point there was a third-party Perl implementation too.

Unfortunately there wasn't a good way for the other browsers to implement it. Or perhaps fortunately, depending on your point of view…

Re:Ask HN: Why is everything in JavaScript changing so fast? by zeveb on Friday October 21, 2016 @11:10AM (#12761050)
> I believe JS came here because it actually is the best language we have had in the web.

It is the only language we have had in the web (modulo some minor experiments). The only reason it's popular in the browser is because it's the only choice at all. The only reason it is used on the server is because some folks are familiar with it from using (overusing IMHO, but that's a different rant) it in the browser and are not familiar with the advantages of using any other language.

I've written this before, but sometimes in my most morose moment I like to imagine what the world might have been like had Brendan Eich been permitted to implement a Scheme instead. And I don't even like Scheme!

Re:Ask HN: Why is everything in JavaScript changing so fast? by danappelxx on Friday October 21, 2016 @10:45AM (#12760851)
JS won out the web because it came with HTML5, not the other way around.
Re:Ask HN: Why is everything in JavaScript changing so fast? by recursive on Friday October 21, 2016 @01:48PM (#12762760)
JS won out the web long before anyone ever heard of HTML5.
Re:Ask HN: Why is everything in JavaScript changing so fast? by ssalazar on Friday October 21, 2016 @10:54AM (#12760932)
JavaScript beats those out because a.) it integrates with the DOM b.) its the only one that works on every platform today (people seem to forget that before the iPhone, web apps were heavily Flash-based). These features are powerful, but don't necessarily reflect the quality of the language design or development ecosystem.