by iTokio · 7y ago · 0 comments
> [security] checks are necessary for WebAssembly’s safety
> current JavaScript implementations reserve a few registers for their own use, which increases register pressure on WebAssembly
This echoes the arguments for / against java. The compiler in this context mustn’t be “fast enough to be online” - it must be fast enough to keep up and able to smart enough to know what’s important. It also benefits from watching the actual program execution. Presuming you can “warm up” the application, it might just do fine.
I vaguely think that a lot of people are considering the compilation as a one time deal. It could be a phased thing. Java’s a great example of that.
https://hacks.mozilla.org/2018/01/making-webassembly-even-fa...
> One of these speedups is streaming compilation, where the browser compiles the code while the code is still being downloaded. Up until now, this was just a potential future speedup. But with the release of Firefox 58 next week, it becomes a reality.
> Firefox 58 also includes a new 2-tiered compiler. The new baseline compiler compiles code 10–15 times faster than the optimizing compiler.
Seems to deal with the "whereas WebAssembly compilers must be fast enough to run online"
(Some occasional runtime checks would nonetheless be needed, since safety against e.g. excessive stack use could depend on what the program is doing at runtime; but they would be quite rare and come with very little overhead.)