extrawurst / rust-webview-todomvc-yew

lightweight desktop todomvc implementation using rust,wasm and web-view
109 stars 8 forks source link

Wasi compile version? #2

Open jadbox opened 4 years ago

jadbox commented 4 years ago

Was wondering if it's possible to compile this project with support for wasi for things like file io?

extrawurst commented 4 years ago

@jadbox hi nice to meet you again (remember you from my dang times). to be honest I did not try that yet. any chance you wanna have a got with it? :)

jadbox commented 4 years ago

Small world!! Alas my heart is still there in the Dlang community :) I can try to give it a go as it would also be a good learning experience... especially since I'm a venturing a bit far outside my current knowledge domain here (still just learning Rust->wasm basics). xD

jadbox commented 4 years ago

@Extrawurst So I don't think it's possible as I'd originally imagined. This project uses cargo-web which compiles the project to a wasm file and then we run it within the context of a browser. At best, we can use the WASI polyfill (https://github.com/bytecodealliance/wasmtime/tree/master/crates/wasi-c/js-polyfill) but it's seems very experimental and brittle.

Ideally I'm looking for this kind of solution: I'd like to be able to develop "Electron-like" apps that are built into two sections: UI and backend. Both system use wasm, but the backend supports WASI via Wasmer. However, perhaps I'm thinking too small, and the ideal path is just to use webview wasm for everything and just polyfill WASI until web-view's OS targets natively supports WASI (which would be years from now). Hmmm...