WASM is not a replacement to JavaScript and never will be. It's not even a damn language.
WASM is not a replacement to JavaScript and never will be. It's not even a damn language.
WASM fills in a use case where you need to run highly performant code on a browser. It just so happens that you can write it in whatever language you choose.
I do agree it is a shame to lose direct insight to the text source code, but let's be honest the production JS shipped to browsers today is far, far from being human readable. It's minified and shrunk to the most small and incomprehensible degree to save bandwidth. View source and try to read and understand the JS on any big site like facebook.com, etc. and you won't get very far.
I would say a page loading a 1KB JS file better off than a WASM binary blob that's 2MB.
Edit: to be clear, I'm not focusing on performance
That's not exactly correct. It's possible to write equally performant code in just Javascript, by being careful to avoid certain features of the language (e.g. garbage collection, expando objects, dynamic types for variables, etc). Writing code in a stricter language like rust or c++ might make hitting those targets a little easier, but also using TypeScript can make it easier, too.
With the exception of loading, parsing and some JIT profiling, as WASM can potentially be smaller, and it can skip the majority of parsing and early profiling.
So WASM shouldn't be thought of as a tool for achieving speed. It should more be thought of as a means for running cross-platform code, for languages other than Javascript.
Not until either of the two things happen:
- WASM gets GC and can work with DOM directly
- DOM is supplanted by canvas- and webgl-based libraries and frameworks
That JS wasn't a Lisp is kind of a pity, though. But again, Lisps have been around longer than almost any other language yet are still comparatively obscure, which tells me something inhibits their broader adoption.