4 ms·
What's the development process like for a Rust-in-the-browser project like this? I mean, is it like; write some Rust - manually start a compile process - wait a
by Reefersleep 11y ago
What's the development process like for a Rust-in-the-browser project like this? I mean, is it like; write some Rust - manually start a compile process - wait a while - view result in browser - repeat? Are there nice tools? :)
I'm used to working with raw JavaScript, ClojureScript with Figwheel, and Java/xhtml with JSF. Of the three, ClojureScript/Figwheel has given me the smoothest process so far, though I know there are tools for autoreloading raw js as well, just haven't gotten around to using them.
- steveklabnik 11y agoThe general workflow with Rust is $ git clone <foo> $ cd <foo> $ cargo run With something like this, you might want to also use https://github.com/passcod/cargo-watch https://github.com/passcod/cargo-watch , which, after installing it, changes that last line to $ cargo watch and then it will recompile when you change a file, automatically. I haven't been able to test that this project works exactly this way because it looks like they're on an older nightly than I have on my machine, but it looks like that's all you need.
- brson 11y agoI will be amazed if true! Last time I looked at the emscripten-Rust stack it was a tower of hacks and required a custom-hacked standard library. If that's all abstracted behind cargo build scripts that's awesome, but we're still a ways from having this be elegantly integrated into the Rust system. It's going to improve rapidly though.
- steveklabnik 11y agoI think it's gotten better due to recent LLVM changes in emscripten, last I heard, but maybe maybe not. Can't wait until it's just trivial.
- timcameronryan 11y agoThis uses a deeply hacked Rust stack. Take a look at this: https://github.com/tcr/rust-webplatform/blob/master/setup.sh https://github.com/tcr/rust-webplatform/blob/master/setup.sh It's also using a version of Rust that's pre-1.0.0. Progress is being made on making this first class though: https://github.com/rust-lang/rfcs/issues/604 https://github.com/rust-lang/rfcs/issues/604