Allow WebAssembly to directly access the DOM, so you can write whatever language you want and compile it to WebAssembly.
You're mistaking "JS is forced on people and they have no choice but to make it work" with "it's everywhere so it must be good".
And there is absolutely nothing stopping anyone from developing a browser that natively supports another scripting language. Your arms are untied to end the javascript tyranny once and for all.
There's a ton of stuff that will stop you from making your own browser. The distinction here is that nobody is stopping you to BEGIN making your own browser, but dozens of factors will stop you from making it WIDELY VIABLE later -- which you need if you want anybody else but you to use it.
I think you got hung up on "forced". Obviously nobody is saying that pistols put at somebody's forehead were involved. But IE6 and "This browser is not supported" was a thing back then, and that made people compromise a lot and appeal to early JS stupidities.
Then it snowballed and the rest is history.
Speaking of which, it took CSS ages until its devs finally woke up and started adding native animations and transitions for which JS was required. So you were "forced" using JS for those for quite a long time as well.
Don't argue linguistics, please. I'm very sure you knew exactly what I was talking about.
Can you share something else they could've built everything else on top of, instead? Yeah, that's what I thought.
Do you really think a normal junior dev is going to be/should be writing web assembly code to build a basic portfolio website?
Im also curious what language do you think would be suitable instead? And whats your plan to move all the browsers and websites in the world to this new language?
https://i.redd.it/rz3o1yibnc511.png
> And whats your plan to move all the browsers and websites in the world to this new language?
I'm not proposing this, I am saying there should have been options to begin with.
There are a lot of junior developers across the world in different economic situations who might. To think otherwise is just arrogance. Think students, freshers, job-seekers switching industries.
In other words, if your programming language makes it easy for you to shoot yourself in the foot, then it isn't a good programming language to begin with.
Everything is not built on top of it.
> It's the language powering the whole web
It’s also not powering the whole web, just a significant part of the client frontend inside browsers.
Culturally JS doesn't have a tradition of libraries with deep inheritance hierarchies so you aren't wasting a bunch of memory, and cpu, constructing layer upon layer of useless base classes. This is an improvement over both Java and some C++. This also means the GC doesn't have to work as hard.
No it doesn't, but instead it has normalized using a ton of third party packages even for as silly as left-pad [1] that might take your whole application down, put the security of your users in jeopardy or even take bulk of JS built websites down [1]. Even if the left pad incident is excluded, everyday, JS developers rely on unaudited third party libraries from the shitstorm that NPM is. So, you just offset the library problem, not really solved it.
JS solved the package reuse problem. Turns out the ideals of the 1980s had security problems in the 2020s.
Better than C++ where getting third party source building is such a PITA that I got used to seeing decade+ old sources of security critical packages laying around in repos because no one was going to bother trying to get a newer version building.