4 ms·
The hardest part would probably be getting LLVM (written in C++) to compile to webassembly, since that's what rust uses as a compiler backend.
by qw3rty01 5y ago
The hardest part would probably be getting LLVM (written in C++) to compile to webassembly, since that's what rust uses as a compiler backend.
- azakai 5y agoIt takes some work (mostly due to LLVM building code to run later in its build system as it goes), but it's very feasible. LLVM has been ported to Wasm (and before that to JS) many times, for example: https://github.com/jprendes/emception https://github.com/jprendes/emception (2021) https://github.com/tbfleming/cib https://github.com/tbfleming/cib (2017) https://github.com/kripken/llvm.js https://github.com/kripken/llvm.js (2012) I agree it would be great to see this repl running 100% in the browser!
- qw3rty01 5y agoTurns out there's been some work, and the rust part has actually been the main issue: https://github.com/rust-lang/miri/issues/722 https://github.com/rust-lang/miri/issues/722