Rust in 2025: Language interop and the extensible compiler
2025年3月18日
AI 摘要 AI 生成,可能有误
The article argues that Rust should aspire to serve as the new 'lingua franca' for interoperability between programming languages, a role long held by C, by making it easier to combine Rust with other languages in the same process. Rather than extending rustc with built-in knowledge of other languages, the author proposes investing in an 'extensible compiler' built on Rust's core premise of extensibility. This would let crate authors create ergonomic, efficient bridges between Rust and other languages, supporting Rust's goal of targeting foundational applications.
For many years, C has effectively been the “lingua franca” of the computing world. It’s pretty hard to combine code from two different programming languages in the same process–unless one of them is C. The same could theoretically be true for Rust, but in practice there are a number of obstacles that make that harder than it needs to be. Building out silky smooth language interop should be a core goal of helping Rust to target foundational applications. I think the right way to do this is not by extending rustc with knowledge of other programming languages but rather by building on Rust’s core premise of being an extensible language. By investing in building out an “extensible compiler” we can allow crate authors to create a plethora of ergonomic, efficient bridges between Rust and other languages.
继续阅读全文
为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。
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.
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.
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.
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.
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.