27 ms·
At the risk of taking the bait, I'll point out that WASM doesn't just run in web browsers.
by stanleydrew 3y ago
At the risk of taking the bait, I'll point out that WASM doesn't just run in web browsers.
- SirMaster 3y agoI didn't realize that it was used outside of web browsers too.
- Alupis 3y agoFor those of us who have paid no attention to WASM - what is the difference between WASM and old tech like Java Applets? They seem to have similar goals - write once and run it on all the things... Applets had issues, but the pitch seems similar, no? If that is the case, why was a new standard necessary vs. bytecode from JVM or CLR, for instance?
- preseinger 3y agothey're indeed very similar the main difference distills down to execution/implementation java applets were slow, wasm is fast that distinction makes a categorical difference
- Alupis 3y agoIt seems there would still be some sort of interpreter for WASM - meaning any performance gains could have been made using existing bytecode interpreters. I'm probably wrong on that assumption, but am unclear why. I guess I'm wondering what makes WASM so much better than investing engineering energies into existing things.
- preseinger 3y agowasm compiles to "native" code, for whatever "native" means in your execution environment if you're deploying wasm to the browser, then native means your JS engine if you're deploying wasm to the server, then native means actual machine code the competitive advantage versus java is (at a very high level) the language design -- java is much higher-level than wasm, which limits its potential
- Deukhoofd 3y agoIt's an open standardized bytecode that's specifically designed to be easy to implement, which means there are already a lot of different runtimes that implement it, so you're not required to have for example JRE or a .NET runtime installed. Because of this simplicity it is also an easy target to compile to, which means that many languages can already be compiled to it.
- Alupis 3y ago> so you're not required to have for example JRE or a .NET runtime installed These days you are not required to have a JRE or .NET runtime installed. At least on the JRE side, it can be embedded in the executable - I assume .NET has something similar. There has to be more to it than that, though. Perhaps it is the "easy" part you mentioned - I have no idea what's involved in building a greenfield java bytecode interpreter, for example.
- secondcoming 3y agoJava’s bytecode is extremely simple. You could implement a PoC interpreter in a day if you put your mind to it
- Alupis 3y agoInteresting, and good to know. I guess that brings me back to my original question - why WASM vs. some existing bytecode interpreter? What makes WASM the best choice, and why does it exist?
- SideburnsOfDoom 3y agoWASM is "some existing bytecode interpreter". It's widely deployed, i.e. it's in all major browsers already, and has been for a few years now. That alone makes it a good compilation target.
- Alupis 3y ago