Hacker News new | ask | show | jobs
by bArray 1552 days ago
I know that Rust seems quite powerful, but after years spent invested into learning C-family languages (C, C++, Java, Javascript, etc) it's just a pain to learn.

I've not personally spent much time in it, but I hear the biggest complaint is still the compiler support/performance being somewhat random. Can anybody here speak to that?

1 comments

The current issue is really to prevent rebuilding of entire compilation units. Incremental compilation helps somewhat but I haven't found it to be good enough when the size increases. My gut feeling is that it comes from linear or n^2 searches across the entire module due to e.g. parts of the trait system. There's no issue depending on huge crates, when they have been compiled. The first compilation can be painful though. This is especially a problem in CI environments where you need to be clever about the caching vs. clean builds.

To solve this you can move to a workspace structure with internal crates, this makes local changes and tests very fast to compile. For the larger structure you only recompile what is needed starting at where the change originates in true DAG form. On the other hand you can't create dependency cycles.

For a workspace setup look at for example Rust-Analyzer:

https://github.com/rust-analyzer/rust-analyzer/blob/master/C...