172 points · by blackhole · 7y ago · 93 comments
The only reason we haven’t already gotten to 99% native speed is because WebAssembly’s 32-bit integer indexes break LLVM’s vectorization due to pointer aliasing. Once fixed-width SIMD instructions are added, native WebAssembly will close the gap entirely, because this vectorization analysis will have happened before the WebAssembly compilation step.
The differentiator for InNative seems to be the ability to bypass the sandbox altogether as well as additional native interop with the OS. Looks promising!
Rust and Go have support for many targets but not as many as other compilers (GCC), a coverage problem that can be fixed by using WASM as intermediate and porting a WASM Runtime to that architecture.
Something like Innative would also enable desktop applications to be independent of the OS and architecture. The same binary would run on x86_64 Windows, PowerPC Mac and ARMv8 Linux.
It's basically Java but you don't have to use Java to get all the good parts.
(Disclaimer: I know the main dev of innative and do some WASM work myself)
Yeah, instead it matters which WASM runtimes it supports and which archs those runtimes support.
But that's ok, we just need one more layer of abstraction to fix the whole mess.
https://en.wikipedia.org/wiki/UNCOL https://en.wikipedia.org/wiki/Architecture_Neutral_Distribut...
"WebAssembly’s 32-bit integer indexes break LLVM’s vectorization due to pointer aliasing. Once fixed-width SIMD instructions are added, native WebAssembly will close the gap entirely, because this vectorization analysis will have happened before the WebAssembly compilation step."
We're well on our way.
What extra benefit does this provide, except avoiding Oracle?
Jokes aside, why are you comparing these two very different virtual machines? WASM is a general purpose VM, JVM is not. For example, you won’t find a Rust JVM target any time soon. (Not to suggest that the JVM is strictly limited to Java, it isn’t obviously, but it is not nearly as suited to being a target for lower level languages. Also, the security model is very different.)
WASM has been designed from the ground up with portability, security, and stability in mind. It is also a lower target than JVM bytecode, which makes it more suitable to represent languages like rust and go. It has also been designed to take advantage of the sandboxed JIT engines that browsers already have for running javascript. Additionally, WASM is an open standard that anyone can contribute to, which is something that is greatly valued on the web.
https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
Any source?
I'm not sure any of this is any worse than javascript though.
WASM is equivalent to early 80s ISAs but with different opcodes. Native WASM would be most efficient.
Writing an complete compiler backend/asm/ld is a significant undertaking which is only worthwhile for very stable architectures.
The main difference in Bytecode/WASM is memory model and branching support. But you could say that both are equivalent to 80's ISA's.
Precompiled Java is closer to WASM than many would like to admit, so I expect performance to be similar in the long run. This isn't so bad, Java reaches over half native speed on many benchmarks. It's amazing that we'll be able to run untrusted code so quickly
It sure looks like a language to me, like some sort of assembly language.
https://webassembly.org/getting-started/advanced-tools/
https://developer.mozilla.org/en-US/docs/WebAssembly/Text_fo...
granted this is a textual representation (very useful in certain circumstances) but that is semantics. Having done plenty of assembly, I don't see a huge distinction here.
Also, this is not "JITed bytecode", it is compiled AOT.
It’s a shame that the x32 ABI is almost abandoned nowadays, it has some modest improvements for applications that don’t need that much memory.
(The point being that 5% slowdown is a drop in the bucket compared to what we've already lost due to Intel's chip design problems. AIUI, HT is a 15-20% slowdown, and SE was another 20% slowdown.)
Did the Mill CPU finally get first silicon? ;)