Framing Rust’s design goals Rust has been kicking around the idea of design goals, under various names, for some time. Design goals are useful because they give everyone making product decisions a common language and set of priorities to appeal to. If done well, they would accumulate the design wisdom of Rust into a concise package and assist RFC...
Last year was an important year for Async Rust, culminating in the release of async fn in traits, one of Rust’s most long-awaited language features. I’m really proud of the work and expertise the Async Working Group has put in to this effort, and for the community feedback that helped shape the release. We still have important work to do in the...
Last week, Niko Matsakis pointed out a connection to me between for await and something we’ve taken to calling the “buffered streams problem”. This was inconvenient, because I was in the middle of writing a different blog post about what I want Async Rust to look like in a few years, and it challenged some of my assumptions. for await in this...
For just about as long as I’ve been working on async Rust, the topic of scoped tasks has come up. These are async tasks that borrow from their environment, and they would come in handy in a lot of situations. Last year the standard library stabilized thread::scope which allows synchronous threads to do this. You could imagine a similar API, but...
I recently worked out a promising idea with Niko Matsakis and Yoshua Wuyts to solve what I’ll call the “context problem” in Rust. The idea takes inspiration from features in other languages like implicit arguments, effects, and object capabilities. While this is very much at the early stages of development, I’m sharing it here to hopefully get...
My last post, The Rust Organization in 2021, was about how things got done. In this post, I want to talk about what I’d like to see get done: the biggest language, library, and compiler features I’d like to see in 2021. To be sure, this post is more of a “wish list,” in the sense that it may not be possible to do all of it in a year. But these...
When I broke down the kinds of things I want Rust to do in 2021, they fell into two main categories. One was the nuts and bolts of language and compiler features that Rust programmers use every day. The other was organizational: the meta about how those features get implemented. Those organizational aspects are vitally important to how Rust...
In Part 1, we covered how async fns in Rust are compiled to state machines. We saw that the internal compiler implementation uses generators and the yield statement to facilitate this transformation. We also saw that the optimal way to lay out one of these state machines in memory is using an enum-like representation, similar to the following:...
The issue to stabilize an initial version of async/await in Rust has left final comment period. The feature looks slated to stabilize in an upcoming release, most likely 1.39. This represents the culmination of an enormous amount of work by people all over the Rust community. But it’s also only the beginning of async/await support in Rust. The...
At my company, we are moving our medium-sized C++ and Python codebase from CMake to Bazel. Moving to a new build system is a lot of work, so naturally, it has to be justified. Here are the benefits most important to us. First-class build system for C++ Our primary language today is C++, which doesn’t have a standard build system. Bazel’s C++...