Re:Rust Is Surprisingly Good as a Server Language
by ape4 on Monday July 13, 2020 @10:53AM
(#23821385)
I hardly know Rust. What about using many small .rs files so the compilation units are quicker. For a change of one line of code only that .rs needs to be compiled.
[ Parent
| on HN ]
Re:Rust Is Surprisingly Good as a Server Language
by steveklabnik on Monday July 13, 2020 @11:02AM
(#23821480)
Rust's unit of compilation isn't a file, but a crate. (this is ignoring incremental compilation, of course.)
Re:Rust Is Surprisingly Good as a Server Language
by estebank on Monday July 13, 2020 @11:31AM
(#23821810)
Furthermore, most libraries make the stylistic decision of using generics and trait bounds instead of trait objects, which potentially generates faster code at the cost of slower compilation. This also has the consequence of requiring a recompilation of every dependant if that item: if you modify a root item that uses generics you will get a nice recompilation of your entire tree. Edit: working on dependency leaves though is mostly painless. If you don't work on fundamental libraries or frameworks of your system the experience becomes much better, although linking can take quite a while depending on your project.