a year of krabby


on ; by arya dradjica

Precisely one year and one week ago, on , I introduced Krabby. It all started because I had too many ideas about compiler architecture and they stopped fitting in my head. Ever since, Krabby has been the primary focus of my spare time. It’s my favorite thing to do; I’m incredibly grateful to have the time for it, and I’m incredibly proud of what I’ve achieved.

While I had planned to blog about Krabby relatively frequently, I didn’t notice the last eight months slipping by; my last post was written in August 2025. But I’ve made a lot of progress in this time! A few weeks ago, I finally resurfaced from a stack of sub-projects, and I was itching to blog about Krabby again. Given that a year has passed, it seems fitting to hold a little retrospective, and explain what I’ve been up to.

The original version of this post was almost 4000 words long, and it did not cover a lot of the details I wanted to share. (My apologies to the friends I asked to proof-read it!) Instead, I’m going to briefly sketch out my efforts here, and expand on them (in chronological order) in future blog posts.

  1. (TODO) After publishing takeaway, my sight was set on name resolution. But Krabby was not producing the right input for nameres. I first tackled identifier interning, which spiraled into a several-months-long project as I fell down the rabbit hole of (concurrent) hash table optimization. I learnt a lot; it’s the basis for my RustWeek 2026 talk. However, the experience left me bruised. Naively hoping to implement name resolution soon, I took the easy road for building an AST, replacing my incomplete parsing stack with syn.

  2. (TODO) Just a week later, I realized I had blundered; I forgot to consider dependency resolution. Without it, I could not identify crate dependencies or perform inter-crate name resolution. This would severely limit nameres. So I took two weeks to explore dependency resolution, learning how Cargo worked and looking for a way to implement the same behavior. While I learnt a lot, it was quickly clear that a makeshift solution could not be achieved in two weeks, let alone a real dependency resolution algorithm. I tabled it for later.

  3. (TODO) In the last two weeks of 2025, I really tackled name resolution. I had thought long and hard about a name resolution algorithm; I had the chance to discuss it at RustWeek 2025 (which was in May). The algorithm consumed data lazily, and I planned the overall compiler architecture around it. Those two weeks were quite productive, and I managed to implement a lot. But my pace slowly ground to a halt, and I had a minor crisis as I realized that a lazy approach was suboptimal.

  4. (TODO) As 2026 dawned, I began designing and implementing a query system. It is significantly smaller (in scope) than rustc’s query system, but its implementation is complicated by concurrency. At its core, it provides an asynchronous (but high-performance) version of OnceLock. A new mental model for Krabby’s tasks emerged.

  5. (TODO) While implementing the query system, I had trouble debugging race conditions. It turned out that one of the libraries I was using, crossbeam-epoch, was not compatible with MIRI. I made the mistake of looking under the hood of crossbeam-epoch; I realized I could re-implement the library with a simpler algorithm and MIRI support. A full two months later, housekeeping emerged.

  6. (TODO) Back to the query system: I realized that name resolution would require cycle detection, a feature that would also aid type-checking later. I began designing and implementing a concurrent cycle detection algorithm, and along the way adjusted my mental model of Krabby’s control flow.

At the moment, I am working on the query system and cycle detection. I expect this effort will take another month or two. After that, I will apply it to dependency resolution so I can track crate dependencies; this will help me validate the design of the query system. Once this is in place, I will revive name resolution and rewrite it with eager querying. I don’t think I’ll make it beyond that in 2026. But I’m excited to tackle it all!

P.S. I occasionally hear from people that they’ve enjoyed reading these posts, and I’m incredibly grateful for that. I took on Krabby because I love the field of programming, and I wanted to contribute to it in a meaningful way. That contribution is only meaningful if it is shared with and recognized by others. Through this writing, I have met new people, made new friends, and gotten to share in their ideas; thus the field of programming grows. Thank you for reading and thank you for reaching out to me.