4 ms·
Copy-pasting the if/else code (step 2) and then executing resulted in it spinning for about 20 seconds before I lost interest and killed it. The "Hello World" (
by dsizzle 5y ago
Copy-pasting the if/else code (step 2) and then executing resulted in it spinning for about 20 seconds before I lost interest and killed it. The "Hello World" (step 1) did complete, after about 6 seconds.
- cercatrova 5y agoWorks for me, looks like your internet might be slow, at least when connecting to this site, as I believe it works by running the code in the cloud and streaming the results to you. Or perhaps it works on the machine, not sure.
- smt88 5y agoSince Rust can compile to JS and WebAssembly, and Rust's compiler is written in Rust... could you compile Rust in a browser?
- timClicks 5y agoI have been waiting for this to emerge for a few years, but I assume that it must be very difficult because it hasn't happened yet.
- smt88 5y agoIt's probably difficult and also seems mostly useless, right?
- qw3rty01 5y agoThe 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
- azundo 5y agoIt's inconsistent for me - sometimes it runs fine and runs almost immediately, sometimes it hangs for a long time.