wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

fix broken link -- js-polyfill is a 404

Open nuke-web3 opened this issue 3 years ago • 3 comments

I can't find this in the source presently to replace it: the link to js-polyfill is a 404 Can someone put a working link?

nuke-web3 avatar Dec 18 '20 19:12 nuke-web3

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.

sunfishcode avatar Dec 20 '20 15:12 sunfishcode

@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! 😁

nuke-web3 avatar Apr 15 '21 16:04 nuke-web3

No, there isn't yet a new PR for this unfortunately. A lot of parts of WASI have changed, and are still in the process of actively changing. If you want to make the minimal fix here, the most recent version of the original js-polyfill code is https://github.com/bytecodealliance/wasmtime/tree/177af5357880c33863cbe3363754000dbd23bddb/crates/wasi-c.

sunfishcode avatar May 12 '21 17:05 sunfishcode