Posted by em-bee 10/26/2024
No, it won't be faster, if you only optimize a lesser language. If you have higher level code running your optimizer can do more than if it only has a low level version.
No, it won't be more secure. Js0 might be more secure, but if we sites all run any of dozens of different tools those tools are going to be creating the vulnerabilities. It's shifting where security issues occur, and creating more of them.
I'm terrified this could happen. JS has gotten so much better over time. We are so close to being able to not need transpilers. This sounds like such an absurd cop out for browsers to say, meh, we just don't want to do the work to implement. Being so close & then saying, sorry, you must use big toolchains to develop for the web is a monstrously bad future.
I don't see how a browser running JS0 can be any less secure than a browser running JS
Browsers operate at a scale never seen before. Imagine all the extra energy and bandwidth needed if core functionality is moved to the application code when you have billions of users.
What we need is more native functionality (implemented in the JS engine with C++ or Rust) to have as less user land code as possible.
As an example, imagine how much energy, bytes, and CPU would be saved if browsers and JS engines included reactivity and JSX. Or if browsers included an API similar to jQuery.
Quick math to grasp the scale: 100kb * 1 billion users = 100TB of data that needs to be transferred and parsed many times, every single day. It's absurd.