Libc++ 9.0.0 adds explicit support for WASI
releases.llvm.org
releases.llvm.org
How would you load them/link against them + call them in Webassembly land?
Watch Lin Clark's closing keynote at RustConf 2019.
Ideally we'll get to a few very good ones that are alle considered acceptable for most things that will steal good ideas from each other and experiment to find interesting ways forward.
Nobody except their controlling entities really benefited in the long run from having IE as the vastly dominant browser, and I doubt we'll benefit from Chrome's emerging dominance to the same degree. IMHO, the compiler market was greatly benefited by the emergence of Clang as well. Competition is good.
Javascript has become mostly a lost cause as far as open source development goes, as it's basically owned and controlled by NPM Inc and corporate interests now, but WebAssembly at least still has the possibility of remaining open.
At the very least, we should go through a period of experimentation by the community to settle on the best possible solutions (or sets of solution) and let things mature a bit, first. Now is not the time to bless a single runtime, package manager, etc.
Although Wasmer does come with a package manager (WAPM) that uses a proprietary registry like NPM, at least the developers have said they're committed to decentralized hosting[0]. Maybe someone can come up with a completely distributed package management alternative, which I would prefer, but at least Webassembly isn't yet at the degree of centralization that Javascript is.
And really, the only thing going for WebAssembly is being the PNaCL that those corporations were willing to agree on.
Certainly it's better not to have every aspect of a language be centralized. It's already near impossible to distribute Javascript, or even software in many languages, without going through NPM. WebAssembly, thankfully, isn't there yet.
A spec, which is under control of those organisations.
I do know that there are WASI runtimes for non-browser wasm applications.
https://github.com/jfbastien/musl/blob/wasm-prototype-1/arch...
Exceptions don't work natively in wasm yet, that's true. But they do work in wasm+JS (using JS exceptions for unwinding, in Emscripten).
I suspect we'll get exception handling at some point, but for now so much stuff just does not work without it. The whole idea of WASI is that it is not JavaScript-specific, so needing some JavaScript code just to get this basic feature is kind of surprising.
But yeah, for now WASI and wasm don't provide enough to do things like C++ exceptions, longjmp, etc., so Emscripten supports them using non-WASI APIs.
Native exception handling for wasm is being worked on. If we don't want to wait for that, we could do exceptions using Asyncify [2]. But since we have the JS+wasm option for now, and native support coming, that's maybe not worth it.
[1] https://github.com/emscripten-core/emscripten/wiki/WebAssemb...
[1] https://words.steveklabnik.com/is-webassembly-the-return-of-...
JVM yes was initially designed for Java alone, but its research successor, GraalVM, does understand LLVM bitcode thanks to Sulong.
As for "superior" WebAssembly sandboxing, it doesn't protect against internal corruption, due to lack of bounds checking on memory access. Which allows for injected scripts to try to coerce a loaded module to change its behavior. No need to escape the sandbox, sometimes changing the outputs is all that an attack requires.
It remains to be seen how many WebAssembly CVEs will appear when it starts to be more widely targeted by black hats.
And if those WASI modules happen to be written in languages like C and C++, I expect a couple of them to show up.
The existing model does not prevent exploits taking advantage of internal memory corruption inside the sandbox.
UNCOL - https://en.wikipedia.org/wiki/UNCOL
IBM i ILE - https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/...
IBM z/OS Language Environment - https://www.ibm.com/support/knowledgecenter/zosbasics/com.ib...
Xerox Mesa - http://www.softwarepreservation.org/projects/lang/mesa
Xerox Interlisp-D - http://www.softwarepreservation.org/projects/LISP/interlisp_...
UCSD P-Code - https://en.wikipedia.org/wiki/P-code_machine
Modula-2 M-Code - https://www.cfbsoftware.com/modula2/
CLR - https://www.ecma-international.org/publications/standards/Ec...
PNaCL naturally - https://developer.chrome.com/native-client/reference/pnacl-b...
And many many others that I didn't bother to refer to, just WebAssembly is cooler somehow.
The fact it's been done means it's impossible to do. Well-known fact.
In fact, Swift, Go, Java and .NET Native seem to be doing relatively well across their systems level projects, regardless on what naysayers think.
Swift as C and Objective-C replacement on Apple platforms.
Go as the implementation of gVisor used on ChromeOS Crostini security layer and Compute Cloud, Android GPGPU debugger, Fuchsia's TCP/IP stack.
Java, alongside C++ for writing Project Trebel and Android Things drivers. Letting aside all those real time Java projects that run it bare metal, using the likes of PTC, Aicas and Gemalto compilers.
.NET Native across Windows IoT Core and Azure Edge modules.
But lets keep hating GC systems based languages instead.
Any language can be compiled into WASM, but java being garbage collected, it's far from being the case.
WASM is agnostic and flexible and allows a broad range of things.
Java was never designed with the web in mind, and money ruined it, because it tried to do everything, but did everything poorly. WASM can actually make fast webapps a reality, maybe even on android.
And even if it reinvents java, so what? At least it replaces it and fixes its many problems, they are many things that cannot be done in java. Its VM had no chance to be made standard in browsers...
So in short, if you reinvents something, but you make it an open standard, it's clearly an improvement.
If you wish to use a systems programming language, use a systems programming language. Plenty of old ones (Java, C, C++) and plenty of new ones (Go, D, Nim, Rust, Zig) are available. Its like people took a square piece of rock and said:
A: hey, lets chip off some corners so that this can roll!
B: but now its an octagon...
A: well if you put it on a hill it can tumble down!
All the while several styles of modern wheels sit behind them.
I mean, people probably are trying to do systems programming in Javascript, and I agree that's ridiculous, but this isn't an example of it.
Webassembly is just a spec for a language agnostic bytecode. Despite it's name, it isn't even meant to run only in the browser.
It's the same kind of namewashing as javascript's on name. Once more and we can call it a tradition!
In javascript we’ve been stuck using octagon wheels but there’s all these new modern wheels sitting around that we haven’t been able to use because browsers could only run javascript. But now we have a way to fit the modern wheels on our javascript car.
I for one am sick of web apps being so slow and bloated. The day react’s code runs in wasm with native wsdl calls is the day websites the world over will suddenly get a lot faster. What is the problem with that?
WASM is solving the problem Java tried to solve many years ago (and for the most part failed): write once, run anywhere.
Enabling an agnostic compile target is the greatest thing that could ever happen to the web.