I'm getting really tired of this "it has massive adoption" trope.
Let's be clear about it, the merits of the language have nothing to do with its adoption. It's widely adopted because Javascript has a stranglehold on the browsers and people don't have a choice. Nowhere in the software space would such a monopolistic position be acceptable, but hey on the web for some reason it's OK.
So yeah, it's the dominant language but not because it's oh so good or because people think it's awesome (though some of them do and I respect that), it's only because there's absolutely no alternatives.
> Let's be clear about it, the merits of the language have nothing to do with its adoption.
Having a platform that is already out there and which you can execute against without even an install might not prove much more about the merits of a language, but it is a merit in its own right.
Of course, in this particular case... JavaScript isn't exactly widely deployed in hardware, and this device is what provides the platform so... yeah.
> It's widely adopted because Javascript has a stranglehold on the browsers and people don't have a choice.
That's not entirely true. People have had lots of choices. There was Java. There was Flash. There was even VBScript on IE (I bet you didn't know that), not to mention all the EMScripten fun that is now available. Time and again, people choose JavaScript if for no other reason than for its lowest common denominator qualities.
> Nowhere in the software space would such a monopolistic position be acceptable, but hey on the web for some reason it's OK.
If you consider the list of widely used languages for which there is an approved standard by an independent standards body and multiple independent implementations, you end up with a surprisingly short list (and some qualify but by the skin of their teeth). I think, sadly, this is actually quite widely accepted.
Come on. VBScript and Flash? Really? What I meant and you pretend to not understand is that there is no way to use another language just like you use Javascript when scripting a web application. I can't open a console and go
@document.query_selector_all(".fancy").each do |element|
...
end
I find that annoying. That a few companies have tried to introduce proprietary extensions is another topic, it doesn't mean that there is a real choice for developers.
The point is that some people decided some time ago that scripting the web and accessing everything browser-ish (DOM, Canvas, SVG, WebSockets, Web Workers, etc.) meant Javascript and that was it. The lack of choice and variety at hand is absolutely ridiculous. In no other software space would people tolerate to be forced into a technology like that.
> That a few companies have tried to introduce proprietary extensions is another topic, it doesn't mean that there is a real choice for developers.
I spoke in the past tense because those were choices available to developers... JavaScript seems to have won out as a preferred choice. EMScripten opens up a lot of possibilities though...
> In no other software space would people tolerate to be forced into a technology like that.
Good arguments. We had silverlight, and Adobe Air / Flex that may or may not have been trying to displace JS - but they were ways to program in the Browser. Sure they were put forward as solutions by companies that had an agenda.
Such a language also is dependent on HTML-standards.
We should see interpreters for other languages written in JS - or is that far fetched?
Acting like java or flash are or ever were alternatives to javascript is displaying a very profound ignorance of what javascript is for. How do I manipulate the DOM in java? Oh I don't? It is not an alternative option then. Javascript absolutely is the only option, and people have no choice. That is why people invest so much time in writing LANGUAGE_X to javascript compilers, so they can write code in a less terrible language even though it has to be deployed as javascript.
Flash has similar (arguably much better) API's for this as well. There are graveyards filled with other attempts.
> Javascript absolutely is the only option, and people have no choice.
Being the most broadly supported and most integrated solution doesn't mean developers have no choices. It just means they JavaScript might be their best choice. On almost any platform there are going to be certain programming languages that are more integrated and better supported.
> That is why people invest so much time in writing LANGUAGE_X to javascript compilers, so they can write code in a less terrible language even though it has to be deployed as javascript.
And there you have it. JavaScript wins by virtue of being a better deployment platform in the browser space. At one time Java used to enjoy an even broader advantage. Acrobat, Flash, VBA, Bourne Shell, MSI, Unix DBM, SQL, sendmail, PHP, MySQL, Windows, Linux, C, POSIX, PostScript, XWindows, etc. have all ridden these kinds of waves. Some are more successful than others, and certainly the web browser is probably the most ubiquitously deployed runtime environment ever, but really, if anything this is normal and the broad diversity is not.
It's not unfair or unusual, so much as inevitable.
> So, write javascript to trigger a java applet that changes the dom is a reasonable alternative to writing javascript to change the dom?
Depends on what you mean. These days people often have Applets disabled. But if you have an Applet with the access to do so, you can manipulate the DOM as much from it as you could from JavaScript.
> Yes, it literally does. When presented with one option, you have no choice.
There are lots of options, its just one is better than the others.
>> And there you have it. JavaScript wins by virtue of being a better deployment platform in the browser space
> Are you serious?
Absolutely. People made a go of it with Applets. Once they realized they could get the job done with JavaScript, they dropped Applets like a hot potato, to the point where Applets are being dumped.
Most other in browser programming environments are platforms in their own right that talk to browser platform. JavaScript's platform is the browser, and that turns out to make a big difference.
> Just that javascript sucks and we're stuck with it against our will.
You really think pulling the "you are too dumb to understand my bullshit" card is effective? Javascript is used to make changes to the dom in response to the user doing things. User clicks button, stuff changes. Have you ever actually tried doing that with a java applet? Have you noticed how 75% of the api doesn't actually work in any major browser?
...and there you go again about lack of support. Have you noticed that Java Applet's just generally aren't supported anymore? We tried it (and yes, all the event handling worked). No one used it and it exacerbated security problems.
Let's be clear about it, the merits of the language have nothing to do with its adoption. It's widely adopted because Javascript has a stranglehold on the browsers and people don't have a choice. Nowhere in the software space would such a monopolistic position be acceptable, but hey on the web for some reason it's OK.
So yeah, it's the dominant language but not because it's oh so good or because people think it's awesome (though some of them do and I respect that), it's only because there's absolutely no alternatives.