llvm-wasm icon indicating copy to clipboard operation
llvm-wasm copied to clipboard

Same approach but for rust in browser

Open naorzr opened this issue 1 year ago • 1 comments

I was wondering, do you think this approach can be used to run rust in the browser? if so, how would you go about it?

btw, awesome project!

naorzr avatar Aug 22 '23 17:08 naorzr

Thanks!

To run Rust tooling (rustc, cargo, etc.) on the browser, I believe you'd need to compile them to wasm32-emscripten, and the compiled rustc needs to support the wasm32-wasi target. They basically play the role of clang -cc1 or llc in the README.

Looking at https://doc.rust-lang.org/nightly/rustc/platform-support.html, rustc does support compiling to wasm32-wasi which is good, but wasm32-emscripten is only at Tier 2 support w/o host tools, so you'd need to experiment a bit to get it to compile to wasm32-emscripten.

Would love to see rustc running in the browser though!

soedirgo avatar Aug 24 '23 06:08 soedirgo