Home›Baby Steps›Article

The borrow checker within

Jun 2, 2024

AI summary AI-generated, may contain mistakes

The author proposes a four-part roadmap of changes to Rust's borrow checker, dubbed 'the borrow checker within,' intended to help Rust better support code patterns that fit its spirit but currently violate its rules. While the author feels comfortable with the designs, details still need to be scoped out, and a-mir-formality is considered an ideal place to do that work.

This post lays out a 4-part roadmap for the borrow checker that I call “the borrow checker within”. These changes are meant to help Rust become a better version of itself, enabling patterns of code which feel like they fit within Rust’s spirit, but run afoul of the letter of its law. I feel fairly comfortable with the design for each of these items, though work remains to scope out the details. My belief is that a-mir-formality will make a perfect place to do that work.

Keep reading

Out of respect for the author only the opening is shown here. Read the rest on the original site, or in HorizonReader with highlights, notes and AI help.

More from Baby Steps

'Trust but verify'; or, 'the correctness ratchet'

AI summaryThe article describes a 'trust but verify' technique for agentic development, where an agent making a decision that can't be mechanically checked must produce an evidence file documenting its inputs and rationale. CI gates then cheaply and deterministically verify that these evidence files exist and that the inputs are accurate, so any input change forces the agent to revalidate its reasoning. Over time, other agents can re-examine the documented rationale and catch overlooked issues, creating a 'correctness ratchet' that strengthens as agents improve.

What agents mean for Rust (and vice versa)

AI summaryThe author, a programming language designer, reflects on how the rise of LLMs has disrupted the traditionally stable act of programming, acknowledging both the excitement and existential concerns it brings. He concludes that humans will still have a role in programming and that language design remains relevant, arguing that Rust is already a good fit for agentic development though it could be made even better. The post accompanies a talk he gave at REASE/SPLASH and mentions related presentations, including work on the Rust Vision Doc and research shown at IWACO.

Why 'externalized' proofs of cyclic trait impls does not work

AI summaryThis post compares two approaches to handling supertraits: modular proofs, where the trait impl itself establishes that all supertraits hold, versus external proofs, where the code using the impl is responsible for proving the supertraits. The author explains that although modular proofs previously seemed unworkable, external proofs are incompatible with Rust as designed, making modular proofs the only viable option for supporting cyclic trait impls. The post also provides background on what proofs mean in this context.

Cylic trait implementations: motivation

AI summaryThe author announces a blog post series exploring cyclic trait implementations, a problem they have studied for years, with the hope of eventually producing a design suitable for an RFC. This introductory post focuses on the distinction between "internal" and "external" proofs and aims to motivate why the problem matters, connecting abstract ideas to concrete Rust examples.

Battery packs: Let's talk about crates, baby

AI summaryThe blog post introduces 'battery packs,' a concept of curated sets of Rust crates organized around common themes, such as building CLIs, backend web services, embedded development, and error handling. The author notes this is just the beginning, and a key part of the design is that anyone can create their own battery pack.