Minifeed is a curated blog reader and blog search engine. We collect humans-written blogs to make them discoverable and searchable. Sign up to subscribe to blogs, follow people, save favorites, or start your own blog.
Project idea: datalog output from rustc
baby steps | 1 Jan 1 | original ↗

I want to have a tool that would enable us to answer all kinds of queries about the structure of Rust code that exists in the wild. This should cover everything from synctactic queries like “How often do people write let x = if { ... } else { match foo { ... } }?” to semantic queries like “How often do people call unsafe functions in another...

Non-lexical lifetimes using liveness and location
baby steps | 1 Jan 1 | original ↗

At the recent compiler design sprint, we spent some time discussing non-lexical lifetimes, the plan to make Rust’s lifetime system significantly more advanced. I want to write-up those plans here, and give some examples of the kinds of programs that would now type-check, along with some that still will not (for better or worse). If you were at...

Nested method calls via two-phase borrowing
baby steps | 1 Jan 1 | original ↗

In my previous post, I outlined a plan for non-lexical lifetimes. I wanted to write a follow-up post today that discusses different ways that we can extend the system to support nested mutable calls. The ideas here are based on some the ideas that emerged in a recent discussion on internals, although what I describe here is a somewhat simplified...

The Lane Table algorithm
baby steps | 1 Jan 1 | original ↗

For some time now I’ve been interested in better ways to construct LR(1) parsers. LALRPOP currently allows users to choose between the full LR(1) algorithm or the LALR(1) subset. Neither of these choices is very satisfying: the full LR(1) algorithm gives pretty intuitive results but produces a lot of states; my hypothesis was that, with modern...

Unification in Chalk, part 1
baby steps | 1 Jan 1 | original ↗

So in my first post on chalk, I mentioned that unification and normalization of associated types were interesting topics. I’m going to write a two-part blog post series covering that. This first part begins with an overview of how ordinary type unification works during compilation. The next post will add in associated types and we can see what...

Rayon 0.7 released
baby steps | 1 Jan 1 | original ↗

We just released Rayon 0.7. This is a pretty exciting release, because it marks the official first step towards Rayon 1.0. In addition, it marks the first release where Rayon’s parallel iterators reach “feature parity” with the standard sequential iterators! To mark the moment, I thought I’d post the release notes here on the blog: This release...

Unification in Chalk, part 2
baby steps | 1 Jan 1 | original ↗

In my previous post, I talked over the basics of how unification works and showed how that “mathematical version” winds up being expressed in chalk. I want to go a bit further now and extend that base system to cover associated types. These turn out to be a pretty non-trival extension. What is an associated type? If you’re not a Rust programmer,...

gnome-class: Integrating Rust and the GNOME object system
baby steps | 1 Jan 1 | original ↗

I recently participated in the GNOME / Rust “dev sprint” in Mexico City. (A thousand thanks to Federico and Joaquin for organizing!) While there I spent some time working on the gnome-class plugin. The goal of gnome-class was to make it easy to write GObject implementations in Rust which would fully interoperate with C code. Roughly speaking, my...

Query structure in chalk
baby steps | 1 Jan 1 | original ↗

For my next post discussing chalk, I want to take kind of a different turn. I want to talk about the general struct of chalk queries and how chalk handles them right now. (If you’ve never heard of chalk, it’s sort of “reference implementation” for Rust’s trait system, as well as an attempt to describe Rust’s trait system in terms of its logical...

Non-lexical lifetimes: draft RFC and prototype available
baby steps | 1 Jan 1 | original ↗

I’ve been hard at work the last month or so on trying to complete the non-lexical lifetimes RFC. I’m pretty excited about how it’s shaping up. I wanted to write a kind of “meta” blog post talking about the current state of the proposal – almost there! – and how you could get involved with helping to push it over the finish line. TL;DR What can I...

Cyclic queries in chalk
baby steps | 1 Jan 1 | original ↗

In my last post about chalk queries, I discussed how the query model in chalk. Since that writing, there have been some updates, and I thought it’d be nice to do a new post covering the current model. This post will also cover the tabling technique that scalexm implemented for handling cyclic relations and show how that enables us to implement...

Chalk meets SLG
baby steps | 1 Jan 1 | original ↗

For the last month or so, I’ve gotten kind of obsessed with exploring a new evaluation model for Chalk. Specifically, I’ve been looking at adapting the SLG algorithm, which is used in the XSB Prolog engine. I recently opened a PR that adds this SLG-based solver as an alternative, and this blog post is an effort to describe how that PR works, and...

Lessons from the impl period
baby steps | 1 Jan 1 | original ↗

So, as you likely know, we tried something new at the end of 2017. For roughly the final quarter of the year, we essentially stopped doing design work, and instead decided to focus on implementation – what we called the “impl period”. We had two goals for the impl period: (a) get a lot of high-value implementation work done and (b) to do that by...

#Rust2018
baby steps | 1 Jan 1 | original ↗

As part of #Rust2018, I thought I would try to writeup my own (current) perspective. I’ll try to keep things brief. First and foremost, I think that this year we have to finish what we started and get the “Rust 2018” release out the door. We did good work in 2017: now we have to make sure the world knows it and can use it. This primarily means we...

An on-demand SLG solver for chalk
baby steps | 1 Jan 1 | original ↗

In my last Chalk post, I talked about an experimental, SLG-based solver that I wrote for Chalk. That particular design was based very closely on the excellent paper “Efficient top-down computation of queries under the well-founded semantics”, by W. Chen, T. Swift, and D. Warren. It followed a traditional Prolog execution model: this has a lot of...

In Rust, ordinary vectors are values
baby steps | 1 Jan 1 | original ↗

I’ve been thinking a lot about persistent collections lately and in particular how they relate to Rust, and I wanted to write up some of my observations.1 What is a persistent collection? Traditionally, persistent collections are seen as this “wildly different” way to setup your collection. Instead of having methods like push, which grow a vector...

Maximally minimal specialization: always applicable impls
baby steps | 1 Jan 1 | original ↗

So aturon wrote this beautiful post about what a good week it has been. In there, they wrote: Breakthrough #2: @nikomatsakis had a eureka moment and figured out a path to make specialization sound, while still supporting its most important use cases (blog post forthcoming!). Again, this suddenly puts specialization on the map for Rust Epoch 2018....

Rust pattern: Rooting an Rc handle
baby steps | 1 Jan 1 | original ↗

I’ve decided to do a little series of posts about Rust compiler errors. Each one will talk about a particular error that I got recently and try to explain (a) why I am getting it and (b) how I fixed it. The purpose of this series of posts is partly to explain Rust, but partly just to gain data for myself. I may also write posts about errors I’m...

Rust pattern: Precise closure capture clauses
baby steps | 1 Jan 1 | original ↗

This is the second in a series of posts about Rust compiler errors. Each one will talk about a particular error that I got recently and try to explain (a) why I am getting it and (b) how I fixed it. The purpose of this series of posts is partly to explain Rust, but partly just to gain data for myself. I may also write posts about errors I’m not...

An alias-based formulation of the borrow checker
baby steps | 1 Jan 1 | original ↗

Ever since the Rust All Hands, I’ve been experimenting with an alternative formulation of the Rust borrow checker. The goal is to find a formulation that overcomes some shortcomings of the current proposal while hopefully also being faster to compute. I have implemented a prototype for this analysis. It passes the full NLL test suite and also...

MIR-based borrow check (NLL) status update
baby steps | 1 Jan 1 | original ↗

I’ve been getting a lot of questions about the status of “Non-lexical lifetimes” (NLL) – or, as I prefer to call it these days, the MIR-based borrow checker – so I wanted to post a status update. The single most important fact is that the MIR-based borrow check is feature complete and available on nightly. What this means is that the behavior of...

Proposal for a staged RFC process
baby steps | 1 Jan 1 | original ↗

I consider Rust’s RFC process one of our great accomplishments, but it’s no secret that it has a few flaws. At its best, the RFC offers an opportunity for collaborative design that is really exciting to be a part of. At its worst, it can devolve into bickering without any real motion towards consensus. If you’ve not done so already, I strongly...

Never patterns, exhaustive matching, and uninhabited types (oh my!)
baby steps | 1 Jan 1 | original ↗

One of the long-standing issues that we’ve been wrestling with in Rust is how to integrate the concept of an “uninhabited type” – that is, a type which has no values at all. Uninhabited types are useful to represent the “result” of some computation you know will never execute – for example, if you have to define an error type for some...

Rust pattern: Iterating an over a Rc>
baby steps | 1 Jan 1 | original ↗

This post examines a particular, seemingly simple problem: given ownership of a Rc>, can we write a function that returns an impl Iterator? It turns out that this is a bit harder than it might at first appear – and, as we’ll see, for good reason. I’ll dig into what’s going on, how you can fix it, and how we might extend the language in the future...

Rust office hours
baby steps | 1 Jan 1 | original ↗

Hello, all! Beginning this Friday (in two days)1, I’m going to start an experiment that I call Rust office hours. The idea is simple: I’ve set aside a few slots per week to help people work through problems they are having learning or using Rust. My goal here is both to be of service but also to gain more insight into the kinds of things people...

Office Hours #0: Debugging with GDB
baby steps | 1 Jan 1 | original ↗

This is a report on the first “office hours”, in which we discussed debugging Rust programs with gdb. I’m very grateful to Ramana Venkata for suggesting the topic, and to Tom Tromey, who joined in. (Tom has been doing a lot of the work of integrating rustc into gdb and lldb lately.) This blog post is just going to be a quick summary of the basic...

Office Hours #1: Cyclic services
baby steps | 1 Jan 1 | original ↗

This is a report on the second “office hours”, in which we discussed how to setup a series of services or actors that communicate with one another. This is a classic kind of problem in Rust: how to deal with cyclic data. Usually, the answer is that the cycle is not necessary (as in this case). The setup To start, let’s imagine that we were...

October Office Hour Slots
baby steps | 1 Jan 1 | original ↗

Just a quick note that the October 2018 office hour slots are now posted. If you’re having a problem with Rust, or have something you’d like to talk out, please sign up!

MIR-based borrowck is almost here
baby steps | 1 Jan 1 | original ↗

Now that the final Rust 2018 Release Candidate has shipped, I thought it would be a good idea to do another update on the state of the MIR-based borrow check (aka NLL). The last update was in June, when we were still hard at work on getting things to work. Rust 2018 will use NLL now Let’s get the highlights out of the way. Most importantly, Rust...

After NLL: Interprocedural conflicts
baby steps | 1 Jan 1 | original ↗

In my previous post on the status of NLL, I promised to talk about “What is next?” for ownership and borrowing in Rust. I want to lay out the various limitations of Rust’s ownership and borrowing system that I see, as well as – where applicable – current workarounds. I’m curious to get feedback on which problems affect folks the most. The first...

Splash 2018 Mid-Week Report
baby steps | 1 Jan 1 | original ↗

This week I’ve been attending SPLASH 2018. It’s already been quite an interesting week, and it’s only just begun. I thought I’d write up a quick report on some of the things that have been particularly interesting to me, and some of the ideas that they’ve sparked off. Teaching programming (and Rust!) I really enjoyed this talk by Felienne Hermans...

After NLL: Moving from borrowed data and the sentinel pattern
baby steps | 1 Jan 1 | original ↗

Continuing on with my “After NLL” series, I want to look at another common error that I see and its solution: today’s choice is about moves from borrowed data and the Sentinel Pattern that can be used to enable them. The problem Sometimes when we have &mut access to a struct, we have a need to temporarily take ownership of some of its fields....

Rust in 2019: Focus on sustainability
baby steps | 1 Jan 1 | original ↗

To me, 2018 felt like a big turning point for Rust, and it wasn’t just the edition. Suddenly, it has become “normal” for me to meet people using Rust at their jobs. Rust conferences are growing and starting to have large number of sponsors. Heck, I even met some professional Rust developers amongst the parents at a kid’s birthday party recently....

Polonius and region errors
baby steps | 1 Jan 1 | original ↗

Now that NLL has been shipped, I’ve been doing some work revisiting the Polonius project. Polonius is the project that implements the “alias-based formulation” described in my older blogpost. Polonius has come a long way since that post; it’s now quite fast and also experimentally integrated into rustc, where it passes the full test suite....

Polonius and the case of the hereditary harrop predicate
baby steps | 1 Jan 1 | original ↗

In my previous post about Polonius and subregion obligations, I mentioned that there needs to be a follow-up to deal with higher-ranked subregions. This post digs a bit more into what the problem is in the first place and sketches out the general solution I have in mind, but doesn’t give any concrete algorithms for it. The subset relation in...

Salsa: Incremental recompilation
baby steps | 1 Jan 1 | original ↗

So for the last couple of months or so, I’ve been hacking in my spare time on this library named salsa, along with a number of awesome other folks. Salsa basically extracts the incremental recompilation techniques that we built for rustc into a general-purpose framework that can be used by other programs. Salsa is developing quickly: with the...

Rust lang team working groups
baby steps | 1 Jan 1 | original ↗

Now that the Rust 2018 edition has shipped, the language design team has been thinking a lot about what to do in 2019 and over the next few years. I think we’ve got a lot of exciting stuff on the horizon, and I wanted to write about it. Theme for this edition In 2015, our overall theme was stability. For the 2018 Edition, we adopted productivity....

Async-await status report
baby steps | 1 Jan 1 | original ↗

I wanted to post a quick update on the status of the async-await effort. The short version is that we’re in the home stretch for some kind of stabilization, but there remain some significant questions to overcome. Announcing the implementation working group As part of this push, I’m happy to announce we’ve formed a async-await implementation...

More than coders
baby steps | 1 Jan 1 | original ↗

Lately, the compiler team has been changing up the way that we work. Our goal is to make it easier for people to track what we are doing and – hopefully – get involved. This is an ongoing effort, but one thing that has become clear immediately is this: the compiler team needs more than coders. Traditionally, when we’ve thought about how to “get...

AiC: Adventures in consensus
baby steps | 1 Jan 1 | original ↗

In the talk I gave at Rust LATAM, I said that the Rust project has always emphasized finding the best solution, rather than winning the argument. I think this is one of our deepest values. It’s also one of the hardest for us to uphold. Let’s face it – when you’re having a conversation, it’s easy to get attached to specific proposals. It’s easy...

AiC: Collaborative summary documents
baby steps | 1 Jan 1 | original ↗

In my previous post, I talked about the idea of mapping the solution space: When we talk about the RFC process, we always emphasize that the point of RFC discussion is not to select the best answer; rather, the point is to map the solution space. That is, to explore what the possible tradeoffs are and to really look for alternatives. This...

AiC: Language-design team meta working group
baby steps | 1 Jan 1 | original ↗

On internals, I just announced the formation of the language-design team meta working group. The role of the meta working group is to figure out how other language-design team working groups should work. The plan is to begin by enumerating some of our goals – the problems we aim to solve, the good things we aim to keep – and then move on to draw...

Async-await status report #2
baby steps | 1 Jan 1 | original ↗

I wanted to give an update on the status of the “async-await foundations” working group. This post aims to cover three things: the “async await MVP” that we are currently targeting; how that fits into the bigger picture; and how you can help, if you’re so inclined; Current target: async-await MVP We are currently working on stabilizing what we...

AiC: Unbounded queues and lang design
baby steps | 1 Jan 1 | original ↗

I have been thinking about how language feature development works in Rust1. I wanted to write a post about what I see as one of the key problems: too much concurrency in our design process, without any kind of “back-pressure” to help keep the number of “open efforts” under control. This setup does enable us to get a lot of things done sometimes,...

AiC: Shepherds 3.0
baby steps | 1 Jan 1 | original ↗

I would like to describe an idea that’s been kicking around in my head. I’m calling this idea “shepherds 3.0” – the 3.0 is to distinguish it from the other places we’ve used the term in the past. This proposal actually supplants both of the previous uses of the term, replacing them with what I believe to be a preferred alternative (more on that...

why async fn in traits are hard
baby steps | 1 Jan 1 | original ↗

After reading boat’s excellent post on asynchronous destructors, I thought it might be a good idea to write some about async fn in traits. Support for async fn in traits is probably the single most common feature request that I hear about. It’s also one of the more complex topics. So I thought it’d be nice to do a blog post kind of giving the...

Announcing the Async Interviews
baby steps | 1 Jan 1 | original ↗

Hello all! I’m going to be trying something new, which I call the “Async Interviews”. These interviews are going to be a series of recorded video calls with various “luminaries” from Rust’s Async I/O effort. In each one, I’m going to be asking roughly the same question: Now that the async-await MVP is stable, what should we be doing next? After...

Async Interview #1: Alex and Nick talk about async I/O and WebAssembly
baby steps | 1 Jan 1 | original ↗

Hello from Iceland! (I’m on vacation.) I’ve just uploaded [the first of the Async Interviews][video] to YouTube. It is a conversation with Alex Crichton (alexcrichton) and Nick Fitzgerald (fitzgen) about how WebAssembly and Rust’s Async I/O system interact. When you watch it, you will probably notice two things: First, I spent a lot of time...

Rust 2020
baby steps | 1 Jan 1 | original ↗

Technically speaking, it’s past the deadline for #rust2020 posts, but I’m running late this year, and I’m going to post something anyway. In this post, I am focusing on what I see as the “largest scale” issues, and not on technical initiatives. If I have time, I will try to post a follow-up talking about some of the key technical initiatives that...

AiC: Improving the pre-RFC process
baby steps | 1 Jan 1 | original ↗

I want to write about an idea that Josh Triplett and I have been iterating on to revamp the lang team RFC process. I have written a draft of an RFC already, but this blog post aims to introduce the idea and some of the motivations. The key idea of the RFC is formalize the steps leading up to an RFC, as well as to capture the lang team operations...

Async Interview #2: cramertj
baby steps | 1 Jan 1 | original ↗

For the second async interview, I spoke with Taylor Cramer – or cramertj, as I’ll refer to him. cramertj is a member of the compiler and lang teams and was – until recently – working on Fuchsia at Google. He’s been a key player in Rust’s Async I/O design and in the discussions around it. He was also responsible for a lot of the implementation...

Async Interview #2: cramertj, part 2
baby steps | 1 Jan 1 | original ↗

This blog post is continuing my conversation with cramertj. In the first post, I covered what we said about Fuchsia, interoperability, and the organization of the futures crate. This post covers cramertj’s take on the Stream trait as well as the AsyncRead and AsyncWrite traits. You can watch the video on YouTube. The need for “streaming” streams...

Async Interview #2: cramertj, part 3
baby steps | 1 Jan 1 | original ↗

This blog post is continuing my conversation with cramertj. This will be the last post. In the first post, I covered what we said about Fuchsia, interoperability, and the organization of the futures crate. In the second post, I covered cramertj’s take on the Stream, AsyncRead, and AsyncWrite traits. We also discused the idea of attached streams...

Async Interview #3: Carl Lerche
baby steps | 1 Jan 1 | original ↗

Hello! For the latest async interview, I spoke with Carl Lerche (carllerche). Among many other crates1, Carl is perhaps best known as one of the key authors behind tokio and mio. These two crates are quite widely used through the async ecosystem. Carl and I spoke on December 3rd. Video You can watch the video on YouTube. I’ve also embedded a copy...

Towards a Rust foundation
baby steps | 1 Jan 1 | original ↗

In my #rust2020 blog post, I mentioned rather off-handedly that I think the time has come for us to talk about forming a Rust foundation. I wanted to come back to this topic and talk in more detail about what I think a Rust foundation might look like. And, since I don’t claim to have the final answer to that question by any means, I’d also like...

Async Interview #4: Florian Gilcher
baby steps | 1 Jan 1 | original ↗

Hello! For the latest async interview, I spoke with Florian Gilcher (skade). Florian is involved in the async-std project, but he’s also one of the founders of Ferrous Systems, a Rust consulting firm that also does a lot of trainings. In that capacity, he’s been teaching people to use async Rust now since Rust’s 1.0 release. Video You can watch...

Async Interview #5: Steven Fackler
baby steps | 1 Jan 1 | original ↗

Hello! For the latest async interview, I spoke with Steven Fackler (sfackler). sfackler has been involved in Rust for a long time and is a member of the Rust libs team. He is also the author of a lot of crates, most notably tokio-postgres. I particularly wanted to talk to sfackler about the AsyncRead and AsyncWrite traits. These traits are on...

Async Interview #6: Eliza Weisman
baby steps | 1 Jan 1 | original ↗

Hello! For the latest async interview, I spoke with Eliza Weisman (hawkw, mycoliza on twitter). Eliza first came to my attention as the author of the tracing crate, which is a nifty crate for doing application level tracing. However, she is also a core maintainer of tokio, and she works at Buoyant on the linkerd system. linkerd is one of a small...

Async Interview #7: Withoutboats
baby steps | 1 Jan 1 | original ↗

Hello everyone! I’m happy to be posting a transcript of my async interview with withoutboats. This particularly interview took place way back on January 14th, but the intervening months have been a bit crazy and I didn’t get around to writing it up till now. Video You can watch the video on YouTube. I’ve also embedded a copy here for your...

Library-ification and analyzing Rust
baby steps | 1 Jan 1 | original ↗

I’ve noticed that the ideas that I post on my blog are getting much more “well rounded”. That is a problem. It means I’m waiting too long to write about things. So I want to post about something that’s a bit more half-baked – it’s an idea that I’ve been kicking around to create a kind of informal “analysis API” for rustc. The problem statement I...

More...