Earlier quoted context omitted.
WASM is tied to existing JavaScript engines and their constraints. For example, WASM doesn't support more efficient control flow because of the design of V8 (and possibly SpiderMonkey): http://troubles.md/posts/why-do-we-need-the-relooper-algorit... https://news.ycombinator.com/item?id=19997091
Tied to the engine is orthogonal to tied to the language. You can compile C, C++, and Rust to WebAssembly. But you still can't compile JS to WebAssembly. Given the large amount of code in JS and the number of JS developers, not being able to support a major general purpose language rules out WASM as a cross platform target in my book.
WebAssembly Interface Types: Interoperate with All the Things
91–100 of 119 posts
Re: WebAssembly Interface Types: Interoperate with All the Things
#92Earlier quoted context omitted.
https://github.com/oracle/graal The evolution from MaximeVM, which is now increasingly being integrated into OpenJDK as part of project Metropolis. As for the CLR, it supports VB.NET, C++ and C# since day one, including a Common Language Specification and Common Type System. Then alongside its history got COBOL, Eiffel, F#, Ruby, Python, Nermele, Clojure,.... IBM and UNISYS mainframes language environments support a…
Again, you keep bringing these up, by they are not the same thing as WASM. Graal does not have a standard binary interchange format for compiled C/Rust/etc.-style programs; it requires per-language support for them and works in terms of program source. The CLR's C++ support is nothing like WebAssembly C++- you either FFI to native code, bypassing the VM, or you compile a limited subset of C++ to unverified bytecode-…
WASM in its current form is still quite limited forcing language runtimes to bring along features that other battlefield proven solutions support out of the box.
Hardly a synonym for unmodified.
Re: WebAssembly Interface Types: Interoperate with All the Things
#93Earlier quoted context omitted.
Please, what wonderful feature does WASM have that neither JVM nor CLR are capable of? Or for that matter, the myriad of bytecode formats devised since UNCOL, like the IBM and UNISYS's language environments on their mainframes.
WASM is much smaller and simpler than either. This makes it easier to implement, both within browsers (as evidenced by most mainstream browsers already supporting it natively, and the rest via a polyfill) and beyond (e.g. the myriad of WASM runtimes out there - both interpreted and JIT/AOT compiled - written in all sorts of languages and usable outside a web browser). Same goes for most other bytecode VMs of a simila…
The WASM that everyone dreams about will be the same size, if it is supposed to match in features.
Plenty of bytecode formats since have been AOT/JIT since the early 70's.
We wouldn't even be discussing WASM if Mozilla wasn't unwilling to implement PNaCL. Apparently being open source, with initial support for C, C++ and OCaml support wasn't enough.
Re: WebAssembly Interface Types: Interoperate with All the Things
#94Earlier quoted context omitted.
DOM bindings are kind of irrelevant when one has WebGL. One example among many ramping up https://platform.uno/
WebGL bindings are on the same footing as DOM bindings- they're not an alternative in this sense, because insofar as we have one we already have the other.
And thanks to many, including HN readership, Chrome and Safari are the only browsers that many businesses care about nowadays.
Re: WebAssembly Interface Types: Interoperate with All the Things
#95Earlier quoted context omitted.
Ah, there it is, the JVM discussion in any WASM thread. I kid. On topic though, I'll be curious to see how bad it really is. The demo video showed code that ended up looking and behaving like normal Rust code. Maybe you'll end up with some oddities like Rust enums not being supported, but w/e. At the end of the day, I don't need to make weird and often gross C bindings in my Rust or Go code. Is that not a huge win? B…
> At the end of the day, I don't need to make weird and often gross C bindings in my Rust or Go code. Is that not a huge win? You just need to manually insert stack growth checks before all function calls in anything that can be called from go to support goroutines, because those can't live on a normal stack and still be sufficiently small to support desired go semantics. Async has similar issues, where the semantics…
Re: WebAssembly Interface Types: Interoperate with All the Things
#96Earlier quoted context omitted.
LLVM bitcode is far worse than WASM bytecode as a standard binary interchange format. It is intentionally non-portable and unstable by its designers. Google tried using it for this purpose with PNaCl and it wasn't great. Apple makes it work by strictly controlling the target hardware they use it for, and with massive investment in the toolchain.
I didn't claim it was a good binary format - I just claimed GraalVM supports it, which it does.
Re: WebAssembly Interface Types: Interoperate with All the Things
#97Earlier quoted context omitted.
Would you please share the "very specific technical differences"? As a long-time JVM user, I am curious about WASM and how it compares to the JVM and CLR.
The simple C-style linear memory model is the most important one IMHO, since this preserves the explicit control over the entire memory layout of an application which languages like C, C++ or Rust allow. Optimizations for efficient use of CPU caches carry over into WASM. AFAIK both CLR and JVM use a much higher level model which is built around fine-grained allocations managed by a GC.
In fact it had two versions of it, Managed C++ released in version 1.0, replaced by C++/CLI with version 2.0.
JVM has support for C-style linear memory model on its unsafe interfaces (the non-public ones), and is being improved via Graal (which understands LLVM bitcode) and Projects Panama/Valhalla.
Re: WebAssembly Interface Types: Interoperate with All the Things
#98Re: WebAssembly Interface Types: Interoperate with All the Things
#99Earlier quoted context omitted.
Java used to work in the browser a quarter-century ago, albeit not very well. Even .NET sort of worked in the browser for both the people who enabled Silverlight. I do believe WASM is different, in a good way, but not just because it works in a browser.
> Java used to work in the browser a quarter-century ago, albeit not very well. Even .NET sort of worked in the browser for both the people who enabled Silverlight. Not Really. They worked With a plugin side to the browser and not really IN the browser. And that makes a big difference. Nor Java Applet, nor Sliverlight not even Flash were offering a smooth, integrated experience with in web page or application. I have…
If you think that WASM apps are not going to crash... :)
Re: WebAssembly Interface Types: Interoperate with All the Things
#100> Document.createElement() takes a string. But when I call it, I’m going to pass you two integers. Use these to create a DOMString from data in my linear memory. Use the first integer as the starting address of the string and the second as the length. This seems like its introducing buffer overflow vulnerabilities, if the code can be tricked into using the wrong numbers. Sure, just into WebAssembly memory, but if eve…
Doesn't each wasm module get its own isolated memory? If so, then you could only shoot your own sensitive foot.