6 ms·
Isn't that not just Java all over again, but this time with JavaScript?
by croes 5y ago
Isn't that not just Java all over again, but this time with JavaScript?
- fmajid 5y agoNo, WASM gets compiled to native code
- youngtaff 5y agoJava bytecode got translated to native too Think we've just got better at runtimes over time (JIT, intermediate formats etc.) and WASM was designed to be good for this rather than needed to work with an already exising bytecode
- fmajid 5y agoReflection and other language features preclude direct translation of Java bytecode to machine code, whereas WASM is designed to be a portable assembly language, closer to the IL of GCC or LLVM.
- _old_dude_ 5y agojava -XX:+PrintCompilation prints all methods/loops generated to native code The reflection API has two issues, a security check each time you call a method and the arguments being transformed to objects. The code is still generated to assembly code but the assembly code is slower because of that overhead.
- pjmlp 5y agoJava and Flash, but now it is Good (TM), because the powers that be decided so. "Everything Old is New Again: Binary Security of WebAssembly" https://www.usenix.org/conference/usenixsecurity20/presentation/lehmann https://www.usenix.org/conference/usenixsecurity20/presentat... So, enjoy the 2nd coming of applets/flash, https://platform.uno/ https://platform.uno/ https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor https://tinygo.org/ https://tinygo.org/ .... favourite stack compiled into WASM.
- adimitrov 5y agoThere are crucial differences between Java applets and JS. - Applets tried to render their own GUI, Wasm doesn't and defers to the browser. - applets needed a big, slow to start and resource hungry VM. Wasm is running in the same thread your JS is also running in, it's light, and loads faster than JS - Java and flash were plugins, which needed to be installed and kept up to date separately. Wasm is baked into your browser's JS engine - Wasm code is very fast and can achieve near native execution speeds. It can make use of advanced optimisations. SIMD has shipped in Chrome, and will soon in Firefox - The wasm spec is very, very good, and really quite small. This means that implementing it is comparatively cheap, and this should make it easy to see it implemented by different vendors. - Java was just Java. Wasm can serve as a platform for any language. See my earlier point about the spec So it's apples and oranges. The need to have something besides JS hasn't gone away, so their use cases might be similar. The two technologies couldn't be more distinct, though.
- croes 5y agoYou must view the browser with JS and WASM as a unit. The browser renders it's own GUI too, it's not OS native The browser uses lots of resources too. The browser is kind of a plugin to the OS and must be updated separately. Java nowadays is pretty fast too. Java VM serves a platform for multiple languages like Scala, Kotlin, Clojure. Let's face it, the browser is the new JVM and a soon it gets the same permissions like the JVM to access the file system and such, we get the same problems.
- Dzugaru 5y ago> a soon it gets the same permissions like the JVM to access the file system and such Like... never? We get better systems as we get more experience. That's why C# was better than Java, Java today is better than Java was when C# launched. That's why we now have amazing languages like Rust and also that's why the same problems will never be the same given we have a ton of experience with VMs, docker, sandboxing in browsers etc.
- westurner 5y agoFrom https://news.ycombinator.com/item?id=24052393 https://news.ycombinator.com/item?id=24052393 re: Starboard: > https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres... : "Subresource Integrity (SRI) is a security feature that enables browsers to verify that resources they fetch (for example, from a CDN) are delivered without unexpected manipulation. It works by allowing you to provide a cryptographic hash that a fetched resource must match." > There's a new Native Filesystem API: "The new Native File System API allows web apps to read or save changes directly to files and folders on the user's device." https://web.dev/native-file-system/ https://web.dev/native-file-system/ > We'll need a way to grant specific URLs specific, limited amounts of storage. [...] > https://github.com/deathbeds/jyve/issues/46 https://github.com/deathbeds/jyve/issues/46 : > Would [Micromamba] and conda-forge build a WASM architecture target?