2022 in review
— 2022-12-23
It's pretty quiet at work right now, and every other application on my phone is telling me it's time to look back. So why not lean in and look back at the last 12 months. Not some big reflection time, but to share some things I've done and liked. I've published about a novel's worth of work in the past year, and probably read a multitude of that. So if you're looking to read some tech related things over the holidays, maybe you'll find something fun in this list!
My own work
Here are things I've worked on and written about this year:
Rust Language Work
- Announcing the Keyword Generics Initiative: Where we announce the creation of the "keyword generics initiative", a new group under the language team looking to add a new type of generic to the language 1.
- More Enum Types: We discuss
what potentially the enum-equivalent of tuples and
impl trait
could look like. This could be useful, for say, easier application error handling. - State Machines II: We take a look at typestates2 in Rust, and explore a way to make them a first-class citizen in Rust by leveraging arbitrary-self-types, enums as first-class types, and anonymous enums. The biggest innovation here is that we'd have a way to prevent them from leaking to enclosing types by using enums instead of generics.
- Inline Crates: We discuss the difference between "crates" and "modules", and explore what feature parity between the two could look like, and what challenges enabling that would bring.
- Keywords I: Unsafe Syntax:
Reflecting on the various meanings of the
unsafe
keyword in Rust. - Keywords II: Const Syntax:
Reflecting on the various meanings of the
const
keyword in Rust.
I didn't know "type states" had a name until after I wrote the post, so they're not mentioned by name in the post.
I'm planning to write an update on the work we've done so far after the holidays. Stay tuned for that I guess?
Async Work
- Why Async Rust: In which I explain what async Rust is, which features it provides, and how we can meaningfully talk about whether it makes sense to adopt.
- Futures Concurrency III:
Select!: A deep-dive into
the async
select!
macro, discussing its various shortcoming, and looking at an alternative structured concurrency operator which doesn't share these shortcomings. - Safe pin projections through view types: Goes into some detail on how we could leverage the "view types" proposal to make pin projections safe. Not quite a full proposal, but intended to give a first impression of what this might look like.
- Futures Concurrency IV: Join
Ergonomics: We take a
look at Swift's
async let
feature, and how we can enable similar semantics in Rust's libraries usingIntoFuture
. - Enhancing
.await
withIntoFuture
: The release 1.64 release notes cover the stabilization ofIntoFuture
, and show some cool things you can do with it. - Async-Iterator crate: A short PSA that I tried the unstable "async fn in traits" feature, and published a crate which makes use of it.
- Postfix Spawn: A first look at
the nature of async Rust's
spawn
-family of APIs, and how we can make them behave in a structured manner. I wrote this in a fever-dream, and probably should write a follow-up. - Async Cancellation II: Time and Signals: A first look at a newly created suite of time-based APIs, combining concurrency and cancellation to create a cohesive set of async control flow constructs.
Miscellaneous
- Rust 2023: My thoughts and vision on the Rust project, late 2022 edition.
Other's work
Here are things I've read this year which were a highlight for me. Some of it was published this year, other things are from earlier years. But either way, these were highlights for me:
Rust
- "Memory Safe Languages in Android 13" by Vander Stoep (Google): provides compelling evidence that adopting Rust does in fact meaningfully reduce the number of memory safety bugs in codebases. And crucially: significantly reduces the number of high/critical vulnerabilities. Imo this is one of the most important reports written about Rust in recent years.
- "Rust Atomics and Locks" by Mara Bos: While technically not yet published, I did get a chance to read the pre-release version, and go in-depth on some of the topics in the book with Mara over the past year. I haven't yet finished the book, but I already feel like I understand atomics so much better now (read: at all), and in my opinion this is a must-have for everyone looking to go going beyond the basics in Rust.
- "Type-Driven API Design in Rust (video)" by Will Crichton: walks through designing an API in Rust step-by-step, showing how Rust's type system can be leveraged to guard against increasingly more kinds of invalid uses.
- "Async destructors, async genericity and completion futures" by Sabrina Jewson: a foray into the design challenges of designing an "async Drop" feature in Rust, providing some sharp insights on the matter. Deep-dives into the design problem space as done at the start of this post are in my opinion something we need more of in the Rust project.
- "The Tower of Weakenings: Memory Models for Everyone" by Aria Beingessner: Explains what provenance is, why we should care, and how we can bring strict provenance to Rust. This is one of those posts which really peels back the cover on the sticks-and-bubblegum nature we're building on, and then proposes a way to actually fix that without proposing everyone need become an expert in the process.
Capabilities
- "No Ghosts!" by Sunfishcode: proposes and explores a design principle for components in complex software systems.
- "What is a Capability" by Sunfishcode: Answers the question: "What is a capability?".
- "Capabilities: effects for free" by Craig et al.: bridges the concept of "capabilities" with "effects", showing how we can use effects as capabilities.
- "Capabilities for Resources and Effects" by Martin Odersky: The Scala project got a 7-year EU research grant to investigate adding capabilities and effects into the language. This describes what that work will be focusing on.
- "Contexts and Capabilities in Rust" by Tyler Mandry: (I was involved with this), describes the "context problem" in Rust, and explains how we could solve this by adding a new "with-clause" language feature.
- "The Path to Components (video)" by Luke Wagner: Goes in-depth on the the WASM component model: what it is, where it's currently at, and where it's headed.
Systemic Safety
"Blaming human error for an outage is like blaming gravity for a building falling over" — Tef on Twitter
- "The New View of Safety (video)" by Todd Conklin: "The next time something goes wrong, switch you thinking from 'who failed' to 'what failed'." Incredibly entertaining speaker talking at the United Steel Workers conference on health safety and environment. It's not directly about tech, but highly applicable to tech.
- "The Field Guide to Understanding Human Error" by Sidney Dekker: I've started this and plan to finish it over the holidays. But so far it's proben to be an incredibly useful resource reflecting on what failure is, and how to think about it.
- "How Complex Systems Fail" by Richard Cook: A great overview of how to think about failure, linking to relevant research backing up each point. Authored by a medical doctor, but highly relevant to many fields including software engineering.
- "Confessions of a Recovering Engineer: Transportation for a Strong Town": An interesting dive into the world of transportation, how to think about safety, and provides a perspective on the politics of institutionalized engineering.
- "Crash-Only Software" by Candea et al.: Another classic computer science paper which I'd only ever heard about, but never actually read. It provides interesting perspectives on failure modes in computing, and how to deal with them.
Compilers
- "Cranelift Progress in 2022" by Chris Fallin: As someone who likes compiler theory more than they enjoy working on compilers directly, this post is a dream. It covers all the compiler improvements that have happened on Cranelift over the past year. It's super inspiring to see a production-grade project have such a strong focus on correctness and meaningfully better abstractions. Being able to follow this work in the open is such a treat!
- "A catalogue of optimizing transformations" by Allen et al.: I've seen this paper referenced many times, but I didn't actually read it until this year. It's pretty pragmatic in how it covers the main optimizations a compiler can implement. Folks sometimes refer to this as: "the good ones", as just by implementing these you can get like 80% of the way there.
Miscellaneous
- "What we owe each other" by Vagrant Gautam: A really good post on justice, feelings, and accountability. Being a human can be hard sometimes, and Vagrant does a fantastic job navigating this. Not an easy read, but one that I found worthwhile.
- "The Five Minute Feedback Fix" by Hillel Wayne: shares a practical formal verification technique which takes all of five minutes to learn, and can be applied to virtually any language or project.
- "Bullshit Jobs" by David Graeber: A reflection on the nature of work, which felt relevant to me since, y'know, I'm a worker and all.
- "IETF RFC 9110: HTTP Semantics" by Fielding et al.: The IETF published a new series of HTTP specs this year, unifying the myriad of previous documents into "semantics", "caching", and separate documents for HTTP/1.1, HTTP/2, and HTTP/3. The "semantics" document is fantastic if you just want to learn how HTTP works, without going into the exact details of the various backing wire protocols. I'm a big fan!
Conclusion
I hope some of this was interesting. I'm off to finish reading some of the books on this list. Happy holidays!