8 ms·
Don't take it bad, but it looks like the java launch a (long) while ago. What makes wasm better than java ?
by bestouff 7y ago
Don't take it bad, but it looks like the java launch a (long) while ago. What makes wasm better than java ?
- JoshTriplett 7y agoThe toolchains for building WebAssembly from numerous languages, for one thing. The existence of an LLVM WebAssembly backend helps. (While eventually there were other languages that targeted the JVM, for a long time if you wanted the JVM sandbox you had to write Java.) WebAssembly also provides a fine-grained API surface area; you can run a WebAssembly sandbox with no external functions provided, or just a few. WebAssembly's sandboxing isn't tied to the web; we're keeping all the same security properties when running code locally, and we're protecting modules from each other too. Also, the WebAssembly bytecode format is designed from the beginning to support many different kinds of languages, including languages that directly store types in memory, rather than keeping everything as garbage-collected or reference-counted objects on the heap.
- beefhash 7y ago> The existence of an LLVM WebAssembly backend helps. So why aren't people just shipping straight up LLVM intermediate language VMs and instead go through wasm? Incidentally, would you consider wasm as a destination language for virtual machines for obfuscation? I.e. is it reasonable enough to implement it all in about a week? Plus I fear like the decompilation/disassembly tooling might be there too soon for it to be a real viable option, but maybe nobody's been working on that yet.
- est31 7y agoLLVM IR is an unstable format, changes a lot and only has one implementation.So it's not well suited for a standard. Google actually did use it for PNaCl but fortunately Mozilla prevailed when wasm was created. "Do what LLVM does" is not a valid strategy. On a related note, I'm glad that Firefox doesn't support the "Do what sqlite does" WebSQL api either, but Chrome (sadly) does.
- jandem 7y ago> So why aren't people just shipping straight up LLVM intermediate language VMs and instead go through wasm? This is answered in the WebAssembly FAQ: https://webassembly.org/docs/faq/#why-not-just-use-llvm-bitcode-as-a-binary-format https://webassembly.org/docs/faq/#why-not-just-use-llvm-bitc...
- pjmlp 7y agoJust like MSIL, Xerox PARC microcoded bytecode, IBM mainframes language environments and plenty of other examples.
- tasogare 7y agoYes the concept, as well as implementations, existed for decades. I think WASM is hype because it comes from the Web/JS community and they have good communication, but technically there is nothing new under the sun.
- afiori 7y agoI would say that being a success instead of a failure is something new. The JVM was successful but not for plugins, nor for embedded safety. Also the fact that many vendors have reached a consensus on both a MVP and an update process to future features looks like a win. If Sun, Microsoft, Apple, and Google had all been on board with the (supposedly free software) JVM the story would have been very different.
- pjmlp 7y agoIronically WebAssembly advocacy keeps being defensive against JVM, while cleverly forgetting the dozens of other formats that also offered similar capabilities, including executing C derived languages.
- biggestdecision 7y ago>WebAssembly also provides a fine-grained API surface area Are there concerns about compatibility when browsers are inevitably forced to reduce that surface area because of a security flaw? And how are we going to keep all browsers on the same page with regard to what functionality they provide? It will suck if wasm turns into a cross browser compatibility nightmare.
- gridlockd 7y agoWASM modules by themselves can do pretty much nothing besides allocating memory. If you want to use some API, you have to explicitly expose it, as a user.
- vbezhenar 7y agoJava failed to deliver safe sandbox. Browsers finally booted it because of numerous vulnerabilities. For me wasm looks exactly like another JVM attempt, but it's a good thing, because the idea is good, we just need better implementation. Now if I don't need sandbox, it's going to be a tougher sell. But who knows, may be it'll outperform JVM on bare metal some day.
- pjmlp 7y agoWebAssembly also has its security issues. Lack of bounds checking for multiple data accesses mapped to the same linear memory block.
- gridlockd 7y agoHow would you enforce bounds checking while supporting unsafe languages?
- pjmlp 7y agoThat is exactly the point, don't advertise WebAssembly as safe bytecode, if unsafe languages are part of the picture without any kind of control. Secondly, nor ISO C or ISO C++ forbid implementations that do bounds checking by default. In fact that is what most modern compilers do by default in debug mode. Finally look at memory tagging in Solaris SPARC ADI, Apple iOS or the upcoming ARM extensions support on Android for how bounds checking is enforced at hardware level while supporting unsafe languages.
- saagarjha 7y ago> In fact that is what most modern compilers do by default in debug mode. Assuming that “debug mode” is -g or equivalent, then I have not seen a modern compiler that does this.
- swiley 7y agoHe’s probably talking about instrumentation (valgrind, ASAN etc.) That’s part of why running instrumented code feels like running python.
- sp332 7y agoJava was wildly successful. It was kicked out of browsers because of its huge attack surface. WASM implementations seem to be going with a sandbox approach out of the gate.
- marcosdumay 7y agoOn the web? If was follow its roadmap, it will become a 1st class web object, interacting with everything else on the same level as JS, HTML, and CSS. That means it will be part of your page, instead of funny images and blurry text with bad UI inside a little box that takes a while to load.
- deleted 7y ago[deleted]
- mike_hock 7y agoA non-technical advantage might be that it's not owned by one company. Also, things don't get adopted because of their technical merits but because of random chance[1], or we wouldn't have Javascript today. So having "just another" go at trying to establish a sensible standard is good enough for me. [1] From a technical standpoint, I consider politics, hype, parasitic corporate behavior, etc, "random chance."
- DonHopkins 7y agoBeing built into the browser. Look how many years and versions of Java made then failed at that promise.