首页›Baby Steps›文章

Temporary lifetimes

2023年3月15日

AI 摘要 AI 生成,可能有误

The Rust lang team design meeting reviewed the author's document on temporary lifetimes, whose current rules date back to a 2014 blog post. Almost a decade later, these rules have rough edges that are a common source of bugs, and the Rust 2024 Edition provides a chance to address them. The document, which is not a proposal, discusses what works well and what doesn't, along with a few sketchy ideas for improvement.

In today’s lang team design meeting, we reviewed a doc I wrote about temporary lifetimes in Rust. The current rules were established in a blog post I wrote in 2014. Almost a decade later, we’ve seen that they have some rough edges, and in particular can be a common source of bugs for people. The Rust 2024 Edition gives us a chance to address some of those rough edges. This blog post is a copy of the document that the lang team reviewed. It’s not a proposal, but it covers some of what works well and what doesn’t, and includes a few sketchy ideas towards what we could do better.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Baby Steps

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

AI 摘要The 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 摘要The 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 摘要This 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 摘要The 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 摘要The 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.