News for hackers. Stuff that matters.
Re:Fast Rust Builds by smoldesu on Sunday September 05, 2021 @12:31PM (#28425528)
I'm not an expert on the language, but I see Rust's build times as fairly justified. Rust's focus is on execution speed and correctness, which means that the compiler needs to be extremely pedantic with CPU targets to know how to optimize your release. Once you have a target outlined, it has to acquire and build the latest versions of your dependencies with the highest level of optimization possible for your specific architecture... that's just a lot of computing, period. Caching is a half-solution to this as the author suggests, but frankly there isn't much juice left to squeeze out of the Rust fruit.

Now, there are still ways to make the compiler choke: the mention of instantiations towards the end is a great example. But in my (non-professional) experience, the build times are pretty tolerable for what it's providing.

Re:Fast Rust Builds by ReactiveJelly on Sunday September 05, 2021 @12:42PM (#28425619)
The critics are right that the build times are slow even in debug mode, and that it's one of the most frustrating things about the language even for experienced users.

There are some alternate codegen backends that aim to fix this by compiling less-optimized debug builds more quickly.

Re:Fast Rust Builds by PoignardAzur on Friday September 10, 2021 @08:10PM (#28488257)
I wouldn't hold my breath too much.

Something I noticed since I've started timing builds is that codegen and linking usually takes less than 30% of the build time for an incremental build.

So in practice, switching to Cranelift and lld/mold will shave maybe 2 seconds off a 10-seconds build. Better, but still flow breaking.

If we want Go-like compile times, we're going to need some more fundamental improvements to the compiler.

Re:Fast Rust Builds by sodality2 on Sunday September 05, 2021 @01:10PM (#28425840)
Ooh, got a link to any of those alternate backends?
Re:Fast Rust Builds by pjmlp on Sunday September 05, 2021 @01:13PM (#28425868)
For example Cranelift and using lld as linker.

Also read the Bevy documentation about improving build times.

Re:Fast Rust Builds by eminence32 on Sunday September 05, 2021 @12:54PM (#28425705)
> the build times are pretty tolerable for what it's providing.

I think this is probably right, and I think just about everyone "tolerates" the build times (that is, I see very few people stop developing in rust because of the build times).

But when, for example, I run `rustup update` to get a new nightly compiler and have to re-compile everything, it's annoying to have to wait 20 minutes. I'll tolerate it, and if a magic wand could make it instantaneous I would love that. But it's still annoying.

Re:Fast Rust Builds by tanaypingalkar on Sunday September 05, 2021 @03:07PM (#28426844)
I have a low spec machine but i still patiently wait for 200 crates to download.Because it is cached. But the most annoying thing is that when I am using any frameworks like gui and game. The second compilation also takes a minute to start the app. I have ended up with them. :(
Re:Fast Rust Builds by rhn_mk1 on Sunday September 05, 2021 @12:43PM (#28425622)
What is the reason to downvote this?
Re:Fast Rust Builds by lostdog on Sunday September 05, 2021 @02:04PM (#28426315)
I didn't downvote it, but it feels like the parent comment is making excuses for rust build times being slow. As someone who's worked with C++, slow build times are a leech to productivity, and I expect new languages to have a better solution than "whatever."