Hacker News new | ask | show | jobs
by Elinvynia 2182 days ago
With Rust you get safety at compile time while avoiding memory safety issues at runtime. The compile times are objectively longer compared to most other languages. But whether this trade-off is worth it for you depends a lot on your company's CI pipeline and the skill of the developers.
2 comments

I'm not sure safety has anything to do with long compile times, can you enlighten?
There’s a lot happening at compile time that less safe languages don’t do. Type checking and type erasure, etc
As the article explains, this all is a relatively minor contribution to compile times.
Ada/SPARK does it.
IIRC, languages like Java and Go compile quite fast, and they are even safer than Rust...
I feel like the long compilation times is going to be a show stopper for smaller teams/companies where you can't afford the loss in productivity.
Anecdotally I can tell you it does not amount to a loss in productivity. Cargo caches built deps so the cost is really only paid once in a while and the advantages of rusts type system are a boon to productivity.
If productivity is important, you really can't afford memory corruption bugs. Those can easily take weeks to hunt down.
It can be slightly annoying -- compared to f.ex. OCaml with its lightning-fast compiler -- but in practice incremental recompilation is much faster than a compilation from scratch so it rarely irks me that badly.