sunfishcode commented on Issue #2526:
The original JS polyfill was built from compiling the initial WASI implementation in Wasmtime written in C with Emscripten. Since then, Wasmtime has moved to an implementation written in Rust and dropped the C version. In theory, it should be possible to compile the Rust code with Emscripten in the same way, however at this time, this has not yet been done.
One lesson learned is that compiling with Emscripten tends to produce a lot of code, while hand-written approaches, such as this one or this tend to be a lot smaller and more flexible. Instead of Implementing WASI on top of a Posix-ish API and bundling an implementation of the Posix-ish API to support that, they can just directly implement the WASI APIs.
At this point, we should probably remove the mentions of the original JS polyfill. Its main purpose was to demonstrate that it's possible to polyfill WASI on the Web, which it did, and now there are better alternatives. The two I linked to above aren't complete, but they're enough for a fair number of use cases.
NukeManDan commented on Issue #2526:
@sunfishcode I wanna close this one out, is there a more recent PR that does what you describe to remove and rework this section? Thanks! :grinning_face_with_smiling_eyes:
Last updated: Dec 23 2024 at 13:07 UTC