Re:Rust Is Surprisingly Good as a Server Language
by johnfn on Monday July 13, 2020 @04:03AM
(#23818318)
Copying 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.
Re:Rust Is Surprisingly Good as a Server Language
by Fiahil on Monday July 13, 2020 @05:33AM
(#23818876)
If 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.
Re:Rust Is Surprisingly Good as a Server Language
by entha_saava on Monday July 13, 2020 @09:17AM
(#23820403)
Static 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.
Re:Rust Is Surprisingly Good as a Server Language
by jfkebwjsbx on Monday July 13, 2020 @06:44AM
(#23819292)
Cargo check does not help with what the parent is talking about, which is a edit-compile-run loop.
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.