re: Will WebAssembly replace JavaScript? Or Will WASM Make JavaScript More Valuable in Future? VIEW POST


I disagree. Javascript as such will of course stick around in the same way that other languages seem to stay relevant as well. But there will be other options and those options will be operating on a completely leveled playing field. You won't have to use it because there are things that you can't do without it. A lot of people will choose not to. Even so, some might still prefer Javascript in the end.

However, what is going to change is that it is first going to lose its special status as the only language usable for frontend development. Then once people are using many languages on top of wasm, it's status as a special language with dedicated browser support will also be up for debate.

Right now it is special in the sense that the runtimes in browsers are specifically made and designed and optimized to run javascript. These runtimes have now been modified to also run wasm. Very soon that will be the primary thing they do. My prediction is that eventually somebody will figure out that javascript interpreters run perfectly fine on top of wasm and that there's no technical need whatsoever to have all these complicated bits and pieces around that are not related to running wasm code.

It's not like javascript is particularly fast. In fact the main early usecase for wasm seems to be not having to use javascript for things that need to be fast. In other words, people will start running javascript on top of a runtime that ships as wasm; in the same way that you can run other interpreted languages like python in wasm.

At that point browsers will know how to run wasm code and everything else just ships as wasm. Javascript will stop being special. If it needs to be fast, people will ship something precompiled as wasm. If it needs to run on old (pre wasm) browsers, they'll still use javascript. If they want to run a particular flavor of javascript, they'll just bundle their own wasm compiled runtime and not wait for all four browsers to be updated. It will be just yet another thing that you run on top of wasm. Transpilation will no longer be necessary if you can ship your own runtime.

code of conduct - report abuse