Well, at least Java didn't win. Those not old enough to remember "applets" may not know how lucky they are. Eich deserves credit for all sorts of things, but not least for saving us from that. And who knows what scripting languages the browsers of tomorrow might support?
It's because the best language is the most ubiquitous one.
You can paper over syntactic annoyances and semantic confusion with a mental mind-shift, and once they do, they become barriers to entry for your competitors. You can't paper over an inability to deploy your software in front of a customer. From the POV of "what's a showstopper, vs. what's an annoyance", ubiquity is the most important feature a language can have.
An "ideal" language is so much more than just the type system or safety or expressibility. This is true of natural languages just as much as computer languages.
It has just as much to do with the tooling, community, support and adoption - again, just like natural languages.
I think the ubiquitous languages ARE the best languages because the purpose of any language, natural, computer or otherwise is to transmit information and meaning. And the ubiquitous ones are, by definition, best suited for that.
I spent a long time avoiding JS at pretty much any cost. Then I bit the bullet and learned how to work in it, really learned (in 2010 or so). I've liked it a lot more ever since, but a lot of that had to do with my previous ignorance to things like closures and first-class functions, which of course are not specific to JS at all.
There are certainly really bad languages (say, brainfuck). Once you admit that some languages are worse than others, you admit that there can be a hierachy. Of course, it's possible for the hierarchy to have a 256-way tie for first place.
I think the ideal would be closer to the asm.js side of things than the JS side.
It's nice that I can inspect the source of any page and read high-level code, but the tradeoffs aren't worth it anymore. I'd much rather have a generic (and FAST!) low-level language with lots of compilers from/to high-level languages.
We sort-of have that today, with languages that compile to JS, but the reality is that 90% of the time you're going to be writing JS, or at least dealing with it. And personally I'd like to avoid that as much as possible.
Just do systems development on narrow hardware platforms, and you won't have to deal with JS at all.
I don't mean to be snarky, but the reality is that JS is the common interface available to all browsers to access internals in a consistent API. In order for anything else to come of age it would take the cooperation of at least three major browser vendors along with a decade for older deprecated versions to disappear. It's not going to happen, get over it...
JS is a pretty nice language and with sourcemaps and tooling, there are a number of other languages that target it. Evolution is happening, and fighting it is like trying to pray to your devine entity to be saved from it all.
Self was bad because prototype based languages are not intuitive. This is why we get the endless years of people trying to explain why it's good or how to use it and endless "discoveries" and "frameworks" to leverage "new" tricks. JS is a mess because it's prototype based, to start. Same reason Pony is more progressive than Erlang (Prolog syntax?).
JS is a mess because it's prototype based, to start.
It's internals are prototype based. The user-visible layer is essentially class-based, but lacks syntactic support for both inheritance and composition.
Unless you have all of the optimizations available to the lowest level you are restricted which is why people complain about "only JS".
There are no optimizations missing from x86 so complaining about it is pointless.
Especially given the improvements in sandboxing having a more powerful underlying language could improve things (note that this doesn't mean it needs access to the API of the underlying OS, which is where Java got itself in trouble).
Unless there exists a way to peel back that layer it is immaterial. Asking for something that doesn't exist is different than asking to have access to a layer that does exist.
There's no such think as the best language... every language makes choices for either better performance, or ease of use. Not to mention style (more functional, more OO) and any number of other variations that are purely subjective not necessarily best.
To me, JS is one of the best languages out there. It's expressive, functional and versatile.