ActiveX and Java Web Start, etc all tried to do this, and all of them ended up deprecated and out of favor for native web solutions.
Java IDEs did a lot of this for many years (Eclipse, IntelliJ, NetBeans, JDeveloper, etc) and they worked reasonably well on the desktop, but had no path to offering a web hosted solution (like gitpod or codespaces)
There are not a lot of options here, compiling down a native solution to wasm and running it in the browser would work, I'm not sure if the performance would be substantially better or more consistent across all OS'es and web unfortunately.
So we are where we are :)