Hacker News new | ask | show | jobs
by qw3rty01 1665 days 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.
2 comments

It 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 (2021)

https://github.com/tbfleming/cib (2017)

https://github.com/kripken/llvm.js (2012)

I agree it would be great to see this repl running 100% in the browser!

Turns out there's been some work, and the rust part has actually been the main issue: https://github.com/rust-lang/miri/issues/722