4 ms·
Well, I like an instantaneous edit-compile loop too, bit I was never bothered by rust compile times. Once you get your cache warm, it's pretty much instant. If
by Fiahil 6y ago
Well, I like an instantaneous edit-compile loop too, bit I was never bothered by rust compile times.
Once you get your cache warm, it's pretty much instant. If not, run `cargo check` instead of `cargo run`. You can also use rust-analyser for an in-editor <1s feedback loop.
- johnfn 6y agoCopying this from someone else I replied to: No, it's an issue for warm caches as well. I had a 10 second compilation cycle to add a comment to a file in a project with a couple hundred lines of code and like 4 lines in my cargo.toml. 10 seconds! For a few hundred lines! Maybe that doesn't sound insane, but extrapolating out, that's at least 100x worse than the languages that I'm used to.
- Fiahil 6y agoIf you were using `cargo run` or `cargo build` instead of `cargo check`, these 10 seconds could be spent in linking the final binary and not running the compiler frontend. for that matter 10 secs is not unheard of for large libraries with a lot of debug symbols. That's why you should use `cargo check` instead : it will only run the rust compiler frontend, but not the LLVM linker.
- jfkebwjsbx 6y agoCargo check does not help with what the parent is talking about, which is a edit-compile-run loop.
- entha_saava 6y agoStatic checking is just a part of correctness verification (pretty large chunk but not enough). It can't catch many logic bugs, eg forgetting to update a variable's value. The type system can't help without non-straightforward techniques, and at that point it is diminishing returns. A powerful type system shouldn't be an excuse for not being able to iterate fast.