I don't think 45k LoC could be considered big, and I _do_ think a couple minutes compile time is a problem. I say that as a C++ programmer, a full recompile will easily get me out of the zone
If you include a couple of C++ stdlib headers you're already well past 45kloc per compilation unit (for instance, including <vector> pulls in about 25kloc of code). Such a file usually compiles in a second or so, but the problem in C++ projects is that each source file pulls in the same headers over and over, which explodes the line count the compiler has to crunch through (I bet that in most bigger C++ projects, the actual project code is less than 5% of what the compiler actually needs to compile).
C is much more predictable, a 45kloc C project should compile and link in under a second for a full rebuild without optimizations, and at most 2..3 seconds with optimizations. The link-step is usually the critical part, since that's hard to speed up by throwing more hardware resources at it.
I have Rust projects that are many times smaller but take much more time for a non-incremental build. Of course, a large difference is that a fresh Rust build (after a cargo clean) compiles all its dependent crates, whereas many C/C++ libraries are provided pre-compiled by whatever system you are compiling on.
Couple of seconds for 45k lines - I think you are too demanding :) But if C++ can compile it in couple of seconds - great, good competition for Rust :)
About race conditions: https://doc.rust-lang.org/nomicon/races.html
try: module.find_element() except: # handle not found else: # handle found
Or this:
if module.find_element(): # handle found else: # handle not found
Lack of binary library support on cargo, not having incremental compilation and linking does hurt.
Facts:
Incremental compilation from 1.24 stable: https://blog.rust-lang.org/2018/02/15/Rust-1.24.html
Cargo recompiles dependencies only after "cargo clean" or after Rust version update.
Cargo surely recompiles common dependencies across crates, unless one uses the workspace trick and even then recompiles do happen.
Just get Gtk-rs, get nightly and then trace the build log. I once even mailed Rust devs about it.
Incremental compilation still isn't up to incremental compilation + incremental linking, which is why I explicitly mentioned both on my comment.
1. Hacker News won't let you downvote someone who replies to you, so it is literally impossible for you to have downvoted in this situation.
2. Both of you are correct, because you're talking about different things. Evgeniy means "You only need to compile your dependencies upon the first build", and you mean "if I use the same dependency in two projects, it will be compiled twice, once on the initial compile of both."
Even when I sometimes sound negative, I really appreciate your work.
Rust achievements thus far already influenced design decisions in other languages.
Except of dangling pointers, Rust has everything else from this list.
About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. For libraries it takes seconds to compile and 1-2 seconds to run "cargo check" (or clippy).