On ongoing work in the Rust compiler team
Or how to answer "what are the compiler team working on?"..
š Hello!
This my first writing about the Rust project, so a little about me and this newsletter:
You might know me as @davidtwco on GitHub or Zulip or anywhere else, Iām currently co-lead of Rustās compiler team. For as long as Iāve been involved in the project, Rust has had a healthy culture of blog posts being a medium for testing out ideas about the language and project, and I want to contribute to that with some of my own ideas for how we might work better. Iāve also got some (very) vague plans to try and use this newsletter to teach myself about parts of the Rust compiler that I donāt know very well, and to experiment with ways of regularly summarising goings-on in the compiler for the benefit of other contributors.
Before I get started, some caveats about everything Iāll write:
All opinions expressed in this newsletter are my own, not the Rust project, Rust compiler team, or my employer, unless I tell you otherwise.
Reviewers of earlier drafts donāt necessarily agree with anything Iāve written.
Just because Iāve proposed something in a blog post doesnāt mean itāll happen - depending on the feedback I get from other contributors and the wider community, I may or may not go forward with some of these ideas.
All of the above is also on this newsletterās about page - which Iāll keep updated.
Iāve been thinking a lot lately about how to answer one specific question - āwhat are the compiler team working on right now?ā - and itās a surprisingly tricky one. I donāt have a good answer to it.
It isnāt that the compiler team arenāt up to much - weāve always got lots to do and the team are always working hard. Itās more that weāve never really found a way to track or direct ongoing work within the team over the long-term. It would be great if there would be a page on the projectās website that listed everything the compiler team were working on.
I think the compiler team work pretty well despite the fact that I canāt really answer that question. Itās an important question though - what are we working on? - because being able to answer that helps keep the community informed, can direct investment and attracts contributors.
We canāt communicate what weāre working on to Rustās users if we donāt know ourselves. If itās hard for me to come up with a list of the compiler teamās ongoing projects, then itās a challenge for the Rust user who isnāt involved in the project.
Knowing what projects are ongoing can help direct investment into the project. Rust is being adopted throughout the industry, and some of those adopters will be looking to contribute back to the project.
One way to do that is to become a member of the Foundation, where that money funds resources like the cloud compute program and the community grants program. Another way is to hire contributors from project teams and sponsor their ongoing contributions and to start teams which contribute to the project. If youāre in that latter camp, you need to work out what to contribute to, and you (hopefully) need to justify that as being in the interests of the Rust project.
Team roadmaps, like the compiler team, language team and library teamās roadmaps from last year, are great for this. If youāre just starting out with contributions, then the roadmap directs you to the areas that are a priority; and when reporting to higher-ups about what youāve contributed, being able to point at team roadmaps makes it easy to show those contributions are aligned with the projectās goals and priorities.
Ongoing projects are great opportunities to attract and retain contributors, but only if the projectās working group or team has momentum behind it. I started contributing during the āimpl periodā back in 2017 - a few months where the project spun up a bunch of working groups all across the project to try and complete the 2017 roadmap.
For a new contributor, the impl period was great because we had a directory of projects that we could get involved in and had other new and experienced contributors to collaborate with. It wasnāt without its issues, and Niko wrote a great blog post on his lessons learned: some of which weāve made great progress on - compiler documentation is in a much better place than it was back in 2018, thanks to the rustc developer guide.
One of the things Iāve always taken away from the impl period was the power of working groups to attract and retain contributors. Iām not sure if there has been any other single event which has attracted and retained as many contributors to the compiler team as the impl period did: @wesleywiserās contributions ramped up during the impl period and Wesley now co-leads the compiler team and contributes to the compiler from Microsoft; @spastorino and @lqd have both been strong, consistent contributors for years and got their start with me in the NLL working group (both now contributing from Futurewei); @matthewjasper also started with the NLL working group and now contributes from my team at Huawei; and obviously thereās also me. We always have contributors come-and-go, thatās the nature of open source, but I donāt think there is anything else weāve tried that has had five contributors stick around for years afterwards.
Weāve had working groups in the compiler team for years since the impl period, but they havenāt always been that successful, and not every working group during the impl period was that successful either. The NLL working group succeeded where other groups didnāt because it had a clear goal, lots of work to do, enough expertise to support the newcomers (thanks @pnkfelix and @nikomatsakis!), and it was very active.
One of the ways that I can answer the question āwhat are we working on?ā is by looking at the teamās working groups. Working groups are the way we try to structure and direct (most of) the compiler teamās efforts today - so on the face of it, this seems like a reasonable way to answer the question.
In practice, it wonāt be a very useful answer, because not all of those groups are very active. Some working groups are - the parallel compiler working group are making great progress and achieving really exciting performance improvements. Some others arenāt - the polymorphisation working group? Not so much (I lead the polymorphisation group, so I donāt mind using it as an example here, there are good reasons weāve not done much).
If we look at the polymorphisation working group from the perspective of our motivations above - its existence doesnāt help the community know what weāre working on (because there isnāt much work happening), it wouldnāt be a good place to direct investment (but how would you know that?), and it wouldnāt be a good place to direct new contributors (thereās nothing going on to get involved with).
One of the things that weāve tried to do with working groups (and similar structures) is direct effort into areas that we think need it. Iām increasingly skeptical that this is something weāre able to do.
As co-lead of the compiler team, Iām not really in a position to be able to direct the work that compiler team members or contributors do. Everyone in the team might even agree that we need to work on our support for debuggers, and we might even create a working group to focus on that, but it doesnāt mean that enough of us will take the time to contribute to that groupās goals so that the group succeeds.
This shouldnāt be too surprising - weāre an open source project and people contribute based on their interests and needs. By creating working groups that have been prescriptive (trying to Field of Dreams our way to achieving our goals), we havenāt actually achieved those goals.
Instead, we should be descriptive and focus on trying to describe what is happening. Working groups are a great force multiplier - when thereās a natural upswell of interest in an area, we should capitalise on that and create structures which help organise that work and attract new contributors - this is exactly what successful working groups like NLL and the parallel compiler group have been able to do.
Itās still a worthwhile goal to try and direct work into parts of the project that need it, but we should separate that from tracking what we are working on. If we try and conflate the two (as weāve been doing), then we succeed at neither.
Instead of taking a top-down approach - creating working groups around areas where some work is happening or where weād like to see work happening - take a bottom-up approach - regularly ask contributors what theyāre working on, and group related work together.
I imagine this working something like the following:
Regularly, every two weeks or month or so, ask regular contributors what theyāre working on. Itās okay if there arenāt any updates. Just a couple sentences or short paragraph describing their ongoing work/goals/projects.
Team leads or an operations team will group related reports together - if there are a handful of people working on diagnostics, then we can group those reports together; if there are lots of people working on the type system, then we can group those reports together.
Once youāve got some groups, we can write a brief overview of the goal thatās being worked towards.
As contributions shift and move to different areas, groups come and go too - so we donāt need to make sure our current set of working groups reflect what people are actually doing.
If a group is consistently appearing, then there might be some momentum there, and we can think about creating structures to leverage that momentum, such as directing new contributors towards it.
We could use the reports or the groups in the compiler teamās weekly meetings, in regular update blogs or as a part of the project/compiler teamās website.
A bottom-up approach like this leverages the dynamics of the open source project that we currently have, rather than trying to impose a structure on that work which doesnāt always exist.
tl;dr:
Be descriptive rather than prescriptive
Take a bottom-up approach to tracking work rather than a top-down approach
Separate tracking ongoing work from future work
Iāve been thinking about this from the perspective of the compiler team because thatās the team Iāve fairly recently started to co-lead, but it probably applies to other teams - whether they have working groups or project groups or initiatives or whatever else - and the project as a whole. Reach out if you want to chat about this more :)
Or, if you work on big open source projects that arenāt Rust, Iād be interested in learning how you approach these problems - get in touch!
Thanks to lqd, Wesley Wiser, Niko Matsakis and Federico Pizzuti for reading earlier drafts of this.