820 karma · joined April 30, 2014
The goal is to build a new platform. Initially, that looks like adding layers on top of existing platforms (which, as you say, already have multiple layers). If we succeed, then we get to start taking out some of the layers.
If you mean at the bottom of the wasm, the the answer is, those won't be legacy APIs. The direction we're heading is to provide POSIX compatibility as an emulation layer on top of a cleaner foundation, rather than just doing POSIX at the base layer.
If you mean that all Wasm engines today are implemented on top of traditional operating system APIs, then yes, that is how things will often work, but that's ok. What really matters is how the virtual platform works. We don't have to expose things like "the filesystem namespace" directly to wasm, even if it's present in the host. And if we don't expose "the filesystem namespace", then we don't have the associated problems, even if the underlying host has them.
As an example of one such tool in practice, compare the task of "list all open file descriptors in an arbitrary Unix process" with "list all strings an arbitrary Unix process incorporates some knowledge of". One is a one-liner (`lsof -p <pid>`) and one is really tricky at best, and probably can't be done reliably.
The blog post linked here is thinking about how the systems themselves could be designed differently, whether that's OS's, frameworks, platforms, languages, clusters, networks, or other things.
To be sure, Unix-domain sockets aren't the answer to everything, but they are an example of a different way to think about communication.
Javascript can be compiled to WebAssembly, and there are people doing it:
https://bytecodealliance.org/articles/making-javascript-run-...
So to really do hello world in C right, in addition to fflush, you also need to check the return value from puts. I've never seen any C tutorial do that though.
https://github.com/sunfishcode/mustang
It supports threads, filesystem, networking, and more!
The library for making Linux system calls is:
This is independent of whether the actual I/O is done via mutation/side-effects/execution/etc. or monads/purity/referential-transparency/etc.
Beyond that, that file is just a simple example for showing how to work with the toolchain and the sandbox.
https://github.com/WebAssembly/design/blob/master/FutureFeat...
The article linked here is an advertisement for a startup.
Also, performance is just one factor. Other criteria include security model, standards and governance, Web integration, nondeterminism.
We're working on APIs too, in WASI, but there's a lot of work to do to build everything you'd need to build Electron-like apps.
Of course, cross-language interfaces will always have tradeoffs. But we see Interface Types extending the space where the tradeoffs are worthwhile, especially in combination with wasm's sandboxing.