Remove the browser practical monopoly, and JS popularity would vanish.
Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.
Easy to reason about, great performance for most cases, simple to debug and write code for, a plethora of libraries, easy to ship, no need to have different teams for backend/frontend, and minimal tooling needed.
If they started using PHP, without monopoly, they would not have switched to JS.
But plenty of people have switched from PHP to python or ruby.
> Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.
Python, C and Java are not.
Right now, you have options to avoid writing js at all. There might be some glue code in js but you can write vast majority of your code in other languages and target js. People still choose to write in js.
Purescript, elm, clojurescript, kotlin, bucklescript, and the list goes on. There is a to-js transpiler for every popular language. Why aren't they seeing more usage?
Because a layer of indirection is a heavy price to pay.
If I could code in Python with zero cost in the browser, I would. Hell, I would code in Lua, Lisp or Ruby if that was the alternative.
So i don't subscribe to idea that js is not popular because of browser monopoly.