5 ms·
As far as I can tell most of the people complaining about Rust having painfully long compile times are just parroting second hand information and don't actually
by p1necone 7y ago
As far as I can tell most of the people complaining about Rust having painfully long compile times are just parroting second hand information and don't actually know. Kinda like the pervasive "but isn't Java really slow?" thing that still doesn't seem to have died either.
Edit: yes I know this article was written by someone who knows what they're talking about (and as they're a steward of the project I understand why they're calling this out for improvement, and somewhat exaggerating how bad it is). I was talking about the occasional comments I see on hacker news about how people aren't even bothering to try rust because compile times are "unusably" bad. 5 mins for a dev build of 2 million lines of code is not anywhere near reason to not even bother trying the language. No personal project or learning scratchpad is ever going to come close to 2 million lines. And it's not worse than many other languages that are used for large projects.
- staticassertion 7y ago> As far as I can tell most of the people complaining about Rust having painfully long compile times are just parroting second hand information and don't actually know. My experience is the opposite. Most rust devs don't work on very large projects from what I can tell, so compile times tend to stay manageable. It's a small percentage that work on projects large enough to hit this problem, and when you hit it it hurts.
- saghm 7y agoI don't necessarily disagree, but this was written by one of the original authors of the Rust compiler, so I think he knows what he's talking about.
- steveklabnik 7y agoI have a few beefs with this article, but to suggest Brian doesn’t know much about Rust is just plain incorrect. He is literally the #2 all time (human) contributor to the project: https://thanks.rust-lang.org/rust/all-time/ https://thanks.rust-lang.org/rust/all-time/
- nwmcsween 7y agoWell if you read the article you would have known the author is one of the co-founders of Rust.
- gpderetta 7y agoI think that it depends on where you are coming from. For Go, C#, Java devs and for those coming from dynamically typed languages, the compilation times will be unbearably slow. C++, scala, swift developers are probably used to slow compilation times.
- pjmlp 7y agoC++ can be relatively fast when making use of binary dependencies and having a modular build.
- josteink 7y agoThis is the one place where Rust differs from many other languages: Dependencies and libraries are typically brought in a source-dependencies and built with your own code. This typically makes the first build of any project considerably slower than for other languages, since you have to also build all your dependencies, but I think it allows for a really simple and predictable way to work, not to mention support any kind of architecture, across all packages. It's obviously a trade-off, but I think it's a trade-off which is clearly worth it.
- pjmlp 7y agoA trade off that requires buying a compiler rig, it is almost unusable to compile Rust stuff from scratch on my travel netbook. If I plan to do some Rust coding on the go (no pun intended), better do a full build at home before packing. A 5m C++ build turns into 30m Rust one, for the same project, ported across languages. Not to mention that it means on a large team project everyone one is compiling the same stuff over and over again, given that cargo does not yet support code cache servers. Yes there are some workarounds like sccache, but they are extra stuff one needs to install.
- josteink 7y ago> Not to mention that it means on a large team project everyone one is compiling the same stuff over and over again, That's a bit dramatical. You typically only compile your dependencies once during the project lifetime. If you on your netbook have done a initial full build, you'll only get incremental builds from there on, just like with C++. But unlike C++, dependency management isn't hell, and you are almost always guaranteed to have your dependency supported on the target you are building, OOB, without any fiddling or setup. It's a trade-off, but I definitely think the Rust-team made the right decision here.
- pjmlp 7y agoWe do have experience, my C++ projects compile much faster than their rewrite in Rust. On common laptops that you buy at the shopping mall, not compiler rigs. I am not doing nothing special, other than all my third party artifacts are binary dependencies, not overusing templates, incremental compilation and incremental linking. Cargo currently doesn't do binary dependencies, so already here I have to wait for the world to compile. And while incremental compiling is already supported, lld still isn't supported on stable. Plus I do have experience using other AOT compiled languages with modules support, since back in the day. So we know what are talking about, and plenty of people on Rust team are quite aware of the problem, however not every can be fixed at the same time.
- liopleurodon 7y ago> We do have experience, my C++ projects compile much faster than their rewrite in Rust Wow. And C++ projects can be quite slow to compile
- pjmlp 7y agoThey can, but you have to compile everything from scratch, not use binary dependencies, disable pre-compiled headers, not having an incremental compiler and linker available, and be an heavy meta-programming user.