cross-posted to rust's reddit
Hello Rust compiler folks! We are very happy to have 30k lines of Rust (about 30% of the codebase) making up the core of the Pants build tool's upcoming 2.0 release! Rust has been a great platform for us: thank you to the entire community for making it such a powerful and productive environment to work in. Before launching 2.0 though, we have a few more things to nail down, and one of them we could use the Rust (compiler) community's help with.
Pant's plugin API is built around
@rules, which are typed functions or coroutines (in Python) that the Pants engine composes based on their type signatures. That composition is known as "rule graph construction", and it's akin to "compiling" the set of
@rules to decide which of them to use at each use site, and what scoped variables to provide to them.
Rule graph construction is implemented in Rust (using the petgraph crate, which has been wonderful!), and while the current implementation was recently modernized and is sufficient for most of our usecases, we're still hitting some limits with larger
@rule graphs. We suspect that these issues are due almost entirely to a lack of experience in writing and maintaining compilers.
On behalf of the Pants community, I'd like to humbly ask the Rust (compiler) community for the huge favor of your insight on this problem: if you have time to read and post either here or on the associated github issue, it would be very appreciated!
The problem statement (in particular the Issue Overview near the end):