4 ms·
> But if they change a few lines in the actual project and compile again it would be near instant. If it’s a big project and the lines you are changing are in
by codetrotter 4y ago
> But if they change a few lines in the actual project and compile again it would be near instant.
If it’s a big project and the lines you are changing are in something that is being used many other places then the rebuild will still take a little while. (30 seconds or a minute, or more, depending on the size of the project.)
Likewise, if you work on things in different branches you may need to wait more when you switch branch and work on something there.
Also if you switch between Rust versions you need to wait a while when you rebuild your project.
I love Rust, and I welcome everything that is being done to bring the compile times down further!
- Lewton 4y ago> (30 seconds or a minute, or more, depending on the size of the project.) I'm working on a largeish modern java project using gradle, and this sounds great... Every time I start my server it takes 40 seconds just for gradle to find out that all the sub projects are up to date, nothing has been changed and no compilation is necessary...
- wtetzner 4y agoYeah, even Maven seems much faster than Gradle, even on a clean build. Neither are especially fast though.
- dcow 4y agoI am not discouraging efforts to make compile times faster. However, I also see a lot of things that would really make Rust soar not being worked on, like syntax quality of life reworks that get complex under the hood being dropped, partially complete features with half baked PRs, IDE tooling and debugging support, interface-types and much of the momentum behind wasm, async traits and the sorely lacking async_std, etc. It seems like every time I dive into something moderately complex I start hitting compiler caveats with links to issues that have been open for 5 years and a bunch of comments like "what's the status of this can we please get this merged?". It can ever so slightly give one the impression that the rust community has decided that the language is mature and the only thing missing is faster compile times.
- insanitybit 4y ago> "what's the status of this can we please get this merged?" Having written Rust professionally for a number of years, this didn't happen too much. Where it did it was stuff like "yeah you need to Box the thing today", which... did not matter, we just did that and moved on. > It can ever so slightly give one the impression that the rust community has decided that the language is mature and the only thing missing is faster compile times. That is generally my feeling about Rust. There are a few areas where I'd like to see things get wrapped up (async traits, which are being actively worked on) but otherwise everything feels like a bonus. In terms of things that made Rust difficult to use, yeah, compile times were probably the number one.
- nicoburns 4y agoThere are a few more fundemental missing pieces for me: - It's impossible to describe a type that "implements trait A and may or may not implement trait B" - It's impossible to be generic over a trait (not a type that implements a trait, the trait itself)
- tialaramex 4y ago> It's impossible to describe a type that "implements trait A and may or may not implement trait B" How is this different from just describing a type that only "implements trait A" ?
- nicoburns 4y agoIt would allow you to call a function to check for trait B and downcast to "implements trait A and B" in the case that it does implement the trait.
- merely-unlikely 4y agoI’m still learning the language but couldn’t you use an enum containing two types to accomplish the same thing?
- wongarsu 4y agoFor the branch-switching usecase you might get some milage out of sccache [1]. For local storage it's just one binary and two lines of configuration to have a cache around rustc, so it's worth testing out. 1: https://github.com/mozilla/sccache https://github.com/mozilla/sccache