I reduced (incremental) Rust compile times by up to 40%
coderemote.dev
coderemote.dev
Having marked pure functions would be ideal though, no doubt.
At the least you'd want to make caching opt-in per macro unless something special was enabled. Forcing the end developer to blacklist incompatible macros feels like an anti-pattern.
and on the 2nd day of work after everything finally worked, it complained because I wanted to return the AST instead of a token stream.
Joke’s on me because I didn’t know you have to use proc macros to transform code and I wound up just rewriting it as a function. Hopefully that doesn’t screw up what I want to do, which is basically compile time correctness checking, but it probably will…
Feels like every time I try to make compile time functionality in rust, I wind up getting sucked into endless type-level shenanigans, and it works, as long as you can tolerate the error messages being nigh unreadable.
WTB “comptime” Rust
---
That said, a one off tool is way lower friction than modifying rustc / building something everyone is subject to.
I think I'd personally prefer it to behave like a linter.
The benefit of telling users "you can split this section off to its own crate" is that the "break" of that can't ever be silent.
12s down to 6s is still abysmally slow for incremental
You change a value 10 times and you lost a minute already