I really don't get the WebAssembly design. It is not Assembly, it doesn't offer any of the benefits of Assembly. The only thing that makes it assembly-like is that it is completely unreadable and mostly unwritable to humans. For those who don't know, WebAssembly implements a stack machine VM, the only appreciable effect of this design decision is that all code becomes spaghetti code.
We could have made a simple AOT-compileable Basic/C/Java-like language, called it a web standard and let people decide for themselves how many layers of compilers they would like to stick in front. But no, that would make everything too easy to debug. We gotta have an incomprehensible binary file, because that looks fast the same way a red car does.
WASM doesn't require a VM, you can compile it AOT just fine. There is really no difference between a C-like language that every browser engine would have to parse and compile, and WASM. Except that parsing WASM is easier and faster, and it uses less bandwidth to send over the wire.
It is a virtual machine by the normal definition of the word, doesn't mean it can't be AOT compiled.
The part of parsing that can be skipped is a minuscule part of compilation, won't do much for performance.
I guess that the binary representation could theoretically be a bit smaller. However the current status is that compilers need to ship a fair amount runtime stuff, like an allocator and basic string handling, so the resulting binary isn't necessarily smaller than the source code of a fully featured language. That of course weighs down compilation as well.
When I said WASM doesn't require a VM, I meant it doesn't need fallback byte-code interpreters, multi-tier instrumented tracing compilers, invasive managed memory, deoptimization checks, etc. Just compiling it once and running that compiled code is fine.
We could have made a simple AOT-compileable Basic/C/Java-like language, called it a web standard and let people decide for themselves how many layers of compilers they would like to stick in front. But no, that would make everything too easy to debug. We gotta have an incomprehensible binary file, because that looks fast the same way a red car does.