WASM/WASI/WASIX support for the full toolchain
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
WASM/WASI/WASIX support for the full toolchain. I want my program to be able to _run on_ and _build on_ platforms "not supported yet" like NetBSD-riscv or FreeBSD-riscv or RedoxOS, when a WASIX runtime is available (in most of the `dotnet` unsupported systems, including future systems). The _running the output_ part is almost there, but seems like nothing else is.
The solution I'd like is something where there is a toolchain built for a WASI(X) platform where the toolchain is run inside WASI(X). A lot of POSIX APIs not present in WASI are available in WASIX (e.g. sockets, threads) and since there is a working port for FreeBSD which is somewhat supported, I think that a lot of code is POSIX out there as I have built the runtime myself and whatever edits or patches I had to make looked POSIX enough to me.
### Issues breakdown:
- [x] WASI(X) support for build outputs and CLR host: Sdk.Wasi is done for WASI; Platform.Uno supports WASM outputs so presumably the CLR host works inside WASM too.
- [ ] WASI(X) support for CLI
- [ ] WASI(X) support for running the entire toolchain (build other projects with a toolchain running inside WASI(X))
- [ ] WASI(X) support for building the runtime and SDK within itself (hardest - likely would need to bring `wasixcc` and full LLVM running in a WASM/WASIX host in as well, as there is a lot of C++, WASI is a supperset of WASM and WASIX is a superset of WASI IIUC; would make this fully self-hosted)
### Issues requesting for features from WASIX/runtime side
- [ ] [Add support for dynamic linking to the runtime [FFI P/Invoke]](https://github.com/wasmerio/wasmer/issues/4230)
### Additional context
Toolchains that can currently run this way (not just target them):
Clang/LLVM can target WASM and also run inside WASM
Zig can run inside WASI
Rust has a toolchain for WASIX output (it works, but notably some crates like `nix` and full `tokio` are not ported yet, they do have their own versioned ones which work)
I want to be able to ship (ideally) my application in a machine-independent format that can run inside a sandbox that can just open a socket and draw to X11 or whatever your "user-level" graphics stack is. Or serve a webserver that way. This provides stronger isolation, potentially later, better browser compatibility with much lower overhead compared to full CPU emulation (like [https://github.com/copy/v86](v86) (which cannot run modern `dotnet` anyway)).
Interesting, related projects:
[WasmWinforms](https://github.com/roozbehid/WasmWinforms) - WinForms in WebAssembly
Current status: WASM builds are/were supported (the above uses Mono for some build parts)
Was sent here from https://github.com/dotnet/dotnet/issues/4405
Thank you.
Regards,
Rishikeshan S/L.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.