Live data from Hacker News

Standardizing WASI: A system interface to run WebAssembly outside the web

hacks.mozilla.org

61–70 of 238 posts

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#61

I would love for WASI/WasmTime to emphasize on: 1. Backwards compatibility with existing libc. (Maybe pick musl) 2. Platform agnostic wasm generation: the same wasm file should run in the browser (with emscripten polyfills) and across ALL OS-es, mobile included. List: iOS, Android, Mac, Linux, Windows, FreeBSD #1 shall enable decades of legacy programs to work with minimal porting, while #2 shall enable true cross pl…

Good news: we fully agree with these goals!

On 1, the libc we're working on[1] is based on musl. It won't ever be 100% compatible with all code, because that runs into constraints imposed by our security goals, but the vast majority of code should eventually just compile when targeting this. (Eventually, because this is all early days.)

On 2, yes, that is explicitly the goals. I'd add that it's not just about OSes, but also about platforms and hardware form factors.

[1] https://github.com/CraneStation/wasi-sysroot

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#62

Should they standardize to run WebAssembly on the Web first? There's like hundreds of things to do: https://webassembly.org/roadmap/ , https://webassembly.org/docs/future-features/

We're working on that, too :) See this post from last Fall where we laid out a way to think about where WebAssembly is going, which use cases to enable, and how: https://hacks.mozilla.org/2018/10/webassemblys-post-mvp-futu...

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#63

Earlier quoted context omitted.

I think the browser shouldn't be a platform at all, frankly, and WASI is one possible way we can finally stop trying to shoehorn it into being one. If everything runs a WASI runtime, which is designed to run applications from the ground up, there really isn't any need for the browser to run applications anymore, is there?

> there really isn't any need for the browser to run applications anymore, is there? Of course there is. You can open a new "application" without installing, just by clicking a link or entering a URL. The beauty of browser as a platform is simplicity of navigation between apps you haven't previously installed. Also, note that the distinction between a document and an application is vague. Is interactive document, per…

Why would you have to install a wasm/wasi binary? You can pull things over a network without a web browser you know.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#64
post #46

Earlier quoted context omitted.

I think the browser shouldn't be a platform at all, frankly, and WASI is one possible way we can finally stop trying to shoehorn it into being one. If everything runs a WASI runtime, which is designed to run applications from the ground up, there really isn't any need for the browser to run applications anymore, is there?

Yeah, sure, you go ahead and reinvent 30 years of cross-platform application APIs. I'll keep using the web until your new ones match maturity.

We have had dozens of cross-platform application APIs running in VM sandboxes, yet the browser is intent on slowly reinventing them anyway.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#65

WASI will have some interesting milestones ahead of it: * Self-hosting (WASI can run inside WASI) * GCC can run in it * Linux can run in it * Quake can run in it * Chrome can run in it

How can self-hosting be achieved considering SPECTRE etc? Surely, since WASI inside WASI couldn't be in different OS processes, there would be an opportunity to leak data between the inner and outer WASI?

There's a difference between asking is self-hosting can be achieved, and if self-hosting can be secure.

Second, I can run an emulator in WASI that implements WASI, including multiple processes. They might not be true OS processes. But as long as I have threads, I can do something.

Also, maybe we get WASI without high precision clocks. /shrug

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#66

Earlier quoted context omitted.

I think the browser shouldn't be a platform at all, frankly, and WASI is one possible way we can finally stop trying to shoehorn it into being one. If everything runs a WASI runtime, which is designed to run applications from the ground up, there really isn't any need for the browser to run applications anymore, is there?

That's like saying "now that we have Minix there isn't any need for Windows anymore". WASI is awesome, but the Web is here to stay.

For sure, but it would be nice if there were alternative ways to run "no-need-to-install" apps without bringing all the weight of a browser with it. There's a large class of apps that don't need to link out to other URLs, don't need CSS engines (if they just need opengl/vulkan for example), and might not need as strict of security as a web page.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#67
post #35

Earlier quoted context omitted.

The idea of isolation that java espoused is not a bad one - it just wasnt executed well. Its not a java only idea either - see Native Client[0]. As with all things, execution and marketing matter. Java was lacking in both. [0] - https://static.googleusercontent.com/media/research.google.c...

OK, that's all correct and valid. Java still exists and is a valid deployment platform. Why is WebAssembly outside of the browser needed?

Well, the second paragraph in the article gives you the answer:

> Why: Developers are starting to push WebAssembly beyond the browser, because it provides a fast, scalable, secure way to run the same code across all machines.

It allows you to use the same code both inside and outside of the browser. For example, Figma might use it, they already have a web app and a regular app, both using WebAssembly, so WASI would perhaps simplify their code or allow them to add more native integration to their app.

Making a product that's a slight variation of an existing product is often enough to gain significant market share. For example, was Chrome needed when there was Firefox? Was Figma or Adobe XD needed when there was Sketch? Is Rollup or Parcel needed when there is Webpack and Gulp? This could go forever. I mean, should Java be the only universal deployment platform?

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#68

ok, so I hate to be this guy and I'm going to do it anyway because it has to be said: Did they just invent Java again? Aren't they promising what Java promised? Won't they hit the same problems that Java hits during its write-one-run-anywhere promises? I'm asking honestly - why is WebAssembly outside of the browser needed?

[deleted]

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#69

Earlier quoted context omitted.

> why is WebAssembly outside of the browser needed? It's arguably a better standard runtime than Java, for certain use cases. You don't see modern compilers targeting the JVM as an output target, but you do see them targeting WASM, there's probably good reason(s) for that (both technical and political/legal). Furthermore, my understanding of WASI is that it allows standardization of _multiple_ runtimes, each domain s…

OK you answered a few of my questions and I still don't see why WASM is a requirement for any of this to happen. No matter what language I use, no matter what platform I deploy to, if I want to interact with a service or with infrastructure, I'm going to have to use the provided API(s), WASM included. If I deploy a pre-compiled binary to an AWS Lambda and an Azure Function, and it works on both, it's because I had to…

Look at it this way, this won't cause any harm and there's some chance that it will develop into something useful and successful.

Right now there's no reason to conclude that this will turn into something that's no better than Java.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#70

Earlier quoted context omitted.

> there really isn't any need for the browser to run applications anymore, is there? Of course there is. You can open a new "application" without installing, just by clicking a link or entering a URL. The beauty of browser as a platform is simplicity of navigation between apps you haven't previously installed. Also, note that the distinction between a document and an application is vague. Is interactive document, per…

Why would you have to install a wasm/wasi binary? You can pull things over a network without a web browser you know.

How?
Post reply on HN