My Rust Story

15 May 2018

The #rustreach project is apparently asking people how they got into Rust, and though I wasn’t asked in person, I thought it may be useful to write down my personal Rust story. Here goes nothing.

I like programming languages. I even wrote my own very unsuccessful one as part of my diploma thesis. It predictably went nowhere and I quickly lost interest. However a certain fascination for programming languages stayed with me. So when I heard of Rust, I decided to take a short look on the project. My first encounter dates back to June 2014: I opened an issue with a suggestion to create a “Zen of Rust” document, which was quickly and rightfully closed as irrelevant.

I note that this date saw the deprecation of the str::from_utf8_owned method. The Rust version du jour was 0.12.0-pre . Development was a lot slower than now; only a few select people were active. I decided to keep my vantage point and look from afar at Rust. It would take until March 2015 before I interacted a second time with the project (I added another alternative to a RFC), and this time my PR was accepted.

Bolstered by this initial success, I decided to take a deep dive and started the “extra_lints” project on March 19, 2015. What better way to learn a language than to write lints for it in itself? The first lint, eq_op , which has survived to this day, although with significant changes, was added short four days later. A few more lints (and weeks) later, @ctjhoa opened an issue suggesting I merge my project with Manish Goregaokar’s “rust-clippy”, which had a few different lints.

So Manish and I joined forces and I became the first co-maintainer. I proceeded to write a rather large number of lints for clippy. Also, since I found our tests wanting, I started to go hunting for real-world codebases to test clippy on, which lead to pull requests to more than a hundred projects. As for clippy, you probably know how that story turned out.

On the third of June 2015, I wrote my first RFC, called “target version”, which was closed after about 50 comments. I note with some satisfaction that the RFC very much describes the same concept as #2052 Epochs (now renamed to “edition”).

Just a day later, I wrote my first blog post about Rust, specifically how to write lints for it. I remember a discussion with Manish that we should have something like that, so I went ahead and wrote it. A bit more than a month later, I published Holy std::borrow::Cow to great reception on /r/rust, so I wrote a redux. Numerous posts about benchmarking, profiling, type shenanigans and various other topics later, I’m one of rust-learning’s “famous bloggers” and my Rust-Java comparison has been plagiarized.

My second crate, optional was created due the fact that Rust at that time lacked enum determinant optimization, which made types like Option<bool> or Option<f32> larger than need be. This is now mostly moot, but the crate is still in use (and may still bring performance benefits on some workloads).

My first successful RFC was #1270 deprecated for everyone, committed on September 5, 2015. Thanks to this, we now can evolve our APIs without fear of sudden breakage. My second successful RFC from May 2016 allowed eliding 'static lifetimes in const and static items; I am proud to say I implemented it myself, awesomely mentored by Niko Matsakis. During that time I also contributed to the Rust benchmarksgame entries.

In November 2015 Hanno Braun organized the Rhein-Main Rust meetup, and I have attended most of the meetups, as well as being a co-organizer for some time.

In December 2015 I joined This Week in Rust, by following through on my suggestion to add a “crate of the week”, to signal-boost well-written, useful crates. I accepted the task of compiling the list of notable changes later, which I have kept up to this day.

Around May 2016, I became interested in procedural macros, and to quench my curiosity, I wrote flamer and later overflower (which marks my first use of specialization). In September, nerd-sniped by a comment Raph Levien left in his xi editor’s rope crate, I started the bytecount crate for high-perf byte counting. It’s used in various projects, notably xi and ripgrep, which use it for screaming fast newline counting.

Around that time, my third child was born, so I somewhat reduced my involvement in the Rust community all through 2017. I still found the time to attend RustFest Kyiv and speak at RustFest Zurich, where my talk was made up mostly of Limericks I’ve been writing on my twitter account since March 2017. I’m currently preparing to emcee RustFest Paris.

Some weeks ago I’ve started the mutagen project, trying to replicate Manish’s project maintenance structure with some modest success (It’s now my most-starred project on github). Despite being usable already, this is very much a research project, and I should probably go back to Uni and write a paper about it. Alas, I have a full-time job and three kids, so that’ll have to wait.

All this stuff might come off as bragging, so let me explain that I would certainly not have been this successful were it not for the Rust language and community. The strictness and footgun-freedom of the compiler let me write code that I wouldn’t have managed in other languages, and indeed not all my attempts of porting Rust code to Java have been successful. Also I haven’t done much of anything by myself: The most successful projects owe a lot to capable co-maintainers and contributors.

So looking back, what made me join and identify with the Rust community? The openness and helpfulness, the great (and fun, too) discussions, the high distribution of awesome people in the community and also the language and tooling. I feel that my profession needs something like Rust (and secretly hope it will be superceded by something even more awesome), to lift up folks even if they don’t use it, just by pushing the boundary of what is deemed practical, or even possible.