3 ms·
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 par
by hmry 3y ago
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.
- __MatrixMan__ 3y agoIs a browser not a VM? I'm interested in WASM because it appears to do JVM things, but without getting you sued or making you write Java.
- hmry 3y agoWhen 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.
- NohatCoder 3y agoIt 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.