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

Same approach but for rust in browser #2

Open
naorzr opened this issue Aug 22, 2023 · 1 comment
Open

Same approach but for rust in browser #2

naorzr opened this issue Aug 22, 2023 · 1 comment

Comments

@naorzr
Copy link

naorzr commented Aug 22, 2023

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 naorzr changed the title Awesome project Same approach but for rust in browser Aug 22, 2023
@soedirgo
Copy link
Owner

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!

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

2 participants