Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A WebAssembly port of Debian #351

Closed
davidar opened this issue Nov 15, 2020 · 3 comments
Closed

A WebAssembly port of Debian #351

davidar opened this issue Nov 15, 2020 · 3 comments

Comments

@davidar
Copy link

davidar commented Nov 15, 2020

The wasmtime WASI background mentions a thought experiment about porting the Debian userspace to WebAssembly. I realise it's probably still too early for this to be much more than a thought experiment, but I'm curious whether there's been much discussion on this topic (as I haven't been able to find it mentioned anywhere else)?

@sunfishcode
Copy link
Member

There have been experiments porting things like coreutils to WASI. Programs that don't rely too heavily on process-related behavior (fork, exec, signals, uid/gid) can often be ported fairly easily.

Can you say more about what you're interested in?

@davidar
Copy link
Author

davidar commented Nov 16, 2020

I'm particularly interested in cross-compiling Debian packages to WASI (without needing to manually patch them, for the most part). It wouldn't necessarily require support for processes and such (so long as the package of interest and its dependencies didn't), though I guess it would require the WASI SDK to be able to operate as a largely drop-in replacement. Dynamic linking may also be a current obstacle.

I guess I'm coming at this from the perspective of appreciating the intention behind things like WAPM, but also feeling like it's reinventing a wheel that Debian et al already solved a long time ago, and with a greater degree of automation and stronger guarantees of reproducible builds (if not byte-for-byte at least in terms of functionality). (More broadly my interest is from a software portability/archival/bootstrapping perspective, as porting a WASM interpreter to a new platform seems an easier task than a full system emulator or a C compiler.)

Perhaps Nix would be a better target for this (given NixOS/nixpkgs#56555, NixOS/nix#2759, a small amount of discussion here)? Anyway, at the moment I'm mainly just interested in finding out who else has been thinking about this topic, and whether they have any tentative plans or preliminary work, etc.

@sunfishcode
Copy link
Member

I think WebAssembly and WASI are cool, however for the purpose you describe here, RISC-V sounds like a better fit. The Debian port to RISC-V is already well underway, and if you look at the challenges that remain, any WebAssembly-based approach would likely have all the same challenges plus many more. There are a number of RISC-V emulators available. RISC-V is an open-standard ISA. You could run real Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants