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

From wasm32-unknown-unknown to wasm32-wasi #204

Open
4 tasks
temeddix opened this issue Oct 26, 2023 · 3 comments
Open
4 tasks

From wasm32-unknown-unknown to wasm32-wasi #204

temeddix opened this issue Oct 26, 2023 · 3 comments

Comments

@temeddix
Copy link
Member

temeddix commented Oct 26, 2023

Report

Rinf does smoothly connect Flutter and Rust right now, but there's one clunky part left: the web.

On the web, with the curren target wasm32-unknown-unknown, many native functionalities including std::thread, std::time::Instant, std::fs are not working. This limitation prevents many crates like tokio and rayon from working on the web, leaving the vast majority of Rust ecosystem being fallen out from the web platform.

The goal is to use wasm32-wasi target for the web, so that users can use Rusts's thread, time, file, network APIs and various crates just like they do on native platforms. If we are able to compile Rust crates to wasm32-wasi, the JavaScript polyfill libraries will handle the rest, utilizing existing web APIs.

This is a tracking issue, as this goal cannot be achieved without community support.

  1. wasmer-js or browser_wasi_shim supports threads polyfill
  2. wasm-bindgen supports wasm32-wasi target
  3. wasm-pack supports wasm32-wasi target
  4. Migrate the Rinf codebase to wasm32-wasi target

Steps to Reproduce

Use any kind of system I/O functionalities on the web. It's very clunky, sometimes even panicking.

System Information

Not really relevant.

@temeddix
Copy link
Member Author

temeddix commented Nov 6, 2023

@temeddix
Copy link
Member Author

temeddix commented Nov 6, 2023

jco might be used as our new JavaScript shim in the future:

@temeddix temeddix changed the title wasm32-unknown-unknown target is too limited From wasm32-unknown-unknown to wasm32-wasi Jan 29, 2024
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

1 participant