3 ms·
Oi. No. To say that WASM and JS run in the same VM is utterly misleading the the point of being wrong. They are not 'The Same VM'. They are 'Different VMs'.
by jollybean 5y ago
Oi.
No.
To say that WASM and JS run in the same VM is utterly misleading the the point of being wrong.
They are not 'The Same VM'. They are 'Different VMs'. That in the case of Chrome and Firefox they happen to executed 'Side By Side' is relevant, but they are not the same vm.
"Because it runs on the same VM, it's as stable as JavaScript, which is extremely stable at this point"
This is a 'double down' on the fallacy that 'They are the same VM'.
"It's effectively instantaneous simply because it's using the same engine as JavaScript, which is already loaded."
First, so you're not going to count the startup time of the 'Engine' in the 'startup time'? But somehow that 'startup time' would be counted for example in JVM startup?
That wouldn't be a useful comparison, wouldn't it?
If you make a WASM-based app, you're going to have to throw in 'net startup time'.
Second, aside form the issue of 'Engine' startup time, you have to consider how quickly the code gets going. It is not 'instantly', nothing is instant in a VM, notably WASM has to 'compile' - not unlike Java bytecode. Java, JS and WASM all have different profiles here. JS is 'very fast' to start, because that's why it's optimized. Java is slower to start but after about 1000 iteratons of a block of code, 'runtime profiling' makes it fast. Often faster than humans could code in C++. WASM is slow to compile, and currently has little in the way of optimization.
Slow to start, slow to compute.
"Because LLVM targets wasm, you've got many many languages that are supported."
I'm guessing you're not a developer, and have never used WASM?
You do realize you can run JS in Java? Or Java in JS? Or Rust on Java? But that would mostly be stupid and pointless in any real world environment, which is why nobody does it?
Which is why nobody runs Java, C#, Python, Elixir in WASM for anything other than a mockup experiment.
So no, my points are all valid.
Today, WASM is the domain of Emscripten and maybe some Rust experiments, and that's that. It's slow, cumbersome, nobody is really invested in it. Maybe someday, but it's not on the horizon just yet.
- colordrops 5y agoYou are going to have to provide evidence of this. Everything I've heard, every presentation I've seen, everything I'm finding online is that JS and WASM share the same VM implementation on major browsers. Both our arguments hinge on whether this is true or not.
- jeffreygoesto 5y agoWhy don't the two of you go and check the Firefox and Chromium source code? That's all open source. You could prove your claim pointing us to the source. Even better, you and us, we could all learn something from that :-).
- grnmamba 5y agoI did and came to the conclusion that v8 implements both JS and WASM.
- pjmlp 5y ago> Which is why nobody runs Java, C#, Python, Elixir in WASM for anything other than a mockup experime Enjoy modern life, https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz... https://platform.uno/uno-platform-for-web-webassembly https://platform.uno/uno-platform-for-web-webassembly https://leaningtech.com/cheerpj/ https://leaningtech.com/cheerpj/ https://teavm.org/ https://teavm.org/
- Hawxy 5y ago> Which is why nobody runs Java, C#, Python, Elixir in WASM for anything other than a mockup experiment. We run C# Blazor in production, as do a number of local firms. For the record it's very pleasant to work with.
- jcelerier 5y ago> To say that WASM and JS run in the same VM is utterly misleading the the point of being wrong. https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/spidermonkey.md https://github.com/bytecodealliance/wasmtime/blob/main/crane... "SpiderMonkey currently has two WebAssembly compilers: The tier 1 baseline compiler (not shown below) and the tier 2 compiler using the IonMonkey JavaScript compiler's optimizations and register allocation." how is it not "the same VM"