Llogiq on stuff

Rust A Decade Later

Hi folks, I’m back from RustWeek, and the ten-year celebration also almost marks ten years of me coding in Rust. Cue the (self-)congratulation and the feel-good things. This is hopefully one of those.

I want to raise one single point that most of the other posts seem to be missing: We’re not done yet. Yes, we can have nice things (and comparing with other languages, we very much do have nice things). But we shouldn’t content ourselves with what we have.

We can have even nicer things.

What’s more, we should have even nicer things. I’ll give a few examples:

  • Rust’s error reporting is famously great. But at least for now, paths in error and lint messages are usually fully qualified, because the compiler fails to keep the information about what paths are in scope when creating the diagnostics. I’ve teamed up with Esteban Kuber and Vadim Petrochenkov so that we may get path trimming in those messages.
  • The Rust compiler has more span information than most compilers do. But a) we don’t always get the full info on macro expansion (notably the Rust for Linux folks found an example where macro_rules! m { ($e:$tt) => { $e }; } m!(1) fails to mark the span of the 1 as involved in a macro). Also unlike C, we currently don’t have an annotation to declare that code has been generated from non-Rust code, which would improve help programs that compile to Rust, such as bindgen. We don’t yet have anyone taking up this thing, but here’s hope we’ll get it anyway.
  • The clippy lint implementer’s workshop led to multiple PRs to make clippy better. I have yet to review some of them, but the results so far are heartening. In the meantime, the clippy performance project has already given us some initial benefits, but there’s a lot of work to be done still.
  • The cargo team will add their own linting infrastructure and take over the few cargo lints clippy currently has, which will likely improve their performance because they will be able to hook into cargo internals for which we currently need to call out to cargo.
  • The current story around mutable statics is suboptimal, with the replacement API being nightly-only, while the original idiom is already a lint error. I’m positive we’ll see something better come out of it.

And that’s only a small portion of the herculean amount of work that continues to be poured into Rust.

So here’s to the next 10 years of Rust improvement. It’s already become better than most of us would have dared to dream, and we should expect to continue to raise the bar even further.