This is definitely a super noob question and possibly misguided. I don't work front end at all. But I am quite aware of the mountain of frameworks built on JavaScript to support modern web applications.
I was reading up on WebAssembly and how one of its intentions was to allow people to write browser code in other languages of their choice. However it seems that is proving to be quite difficult and you still have to fall back on JS at some point.
It got me thinking why don't Google, Mozilla, Apple (and Opera?) come together and build a non-JS interpreter into the browser? Google apparently tried to put Dart interpreter into Chrome but gave up somewhere along the way. So it seems possible, but just a matter of tremendous effort.
Obviously right off the bat I can think of dozen issues with this suggestion.
- This is huge engineering task, maybe impossible to achieve. Maybe it not feasible to have more than one interpreter in a browser without crashing the entire system.
- Maybe big browser vendors have no interest in doing so. They actually prefer JS?
- JS is actually fine, and any other language runtime will run into the same issues.
I am just looking for someone to explain to me at a high-level why this is a terrible idea. Thanks!
Then they decided to create Javascript to give the browser itself a scripting language, then Microsoft copied them with JScript and VBScript, then Macromedia (later Adobe) made Shockwave and Flash, then Microsoft made ActiveX and later Silverlight... but plain old Javascript remained the lowest common denominator that ran everywhere and eventually overtook all the other attempts.
Then when half the users moved to Android and iOS instead of web browsers, well, they each have their own native stacks that completely bypass the Web. And these days there are wannabe-native-for-web-devs like React Native, so even less of a reason to add another language to the Web proper, I guess.