AMAZINGINDEX.COM 让生活多一点 Amazing
59.5
VOL. 2026.10
2026.10.12
← 返回 2026.10.12 日报
日报快照 · Daily Snapshot
NO. 019

Valen 推出更灵活的 Borrow Checker

#ARTICLE HackerNews 2026.10.12
推荐指数 56.0 NO. 019 · 2026.10.12
发布2026/10/11Score118Comments71

Valen 语言设计了一种比 Rust 更宽松的借用检查器,试图在内存安全与开发灵活性之间找到新平衡点。对受困于 Rust 编译器借用规则、但又需要内存安全的系统开发者值得跟踪。

Rust 的借用检查器以严格著称,但 'fighting the borrow checker' 是新手劝退和资深开发者效率损耗的主因之一。Valen 的 relaxed borrow checker 本质上是在追问:所有权系统的哪些约束是安全必需,哪些只是实现简化?

如果 Valen 能在保持 Rust 级零成本抽象的同时降低心智负担,对游戏引擎、嵌入式等需要手动内存管理但团队 Rust 经验不足的场景会是重大利好。不过目前只是设计文档阶段,71 条 HN 评论里大量在质疑其 soundness 证明是否完整,建议等正式实现和 miri 级别的验证工具出现后再评估生产可用性。

正面 77 条评论

核心争论:Valen 的 Path Borrowing 命名与语义设计,以及能否反向影响 Rust 借用检查器演进

verdagon

Also, as I was writing this, a couple things occurred to me: * We _could_ use the function parameter syntax `entities: &world.entities[]` instead of `entities in world.entities[]`. * "Groups" aren't really central to understanding the idea, so Path Borrowing might be a better name than Group Borrowi

munchler

FWIW `foo in bar` implies iteration to me, not a path. In the .NET world, for example, `bar` would be a collection that we’re iterating through, assigning each element to `foo` in turn.

scotty79

Love both.

替代方案: RustValeVx langMojoFutharkZigGhostCellQCellLCell
查看原文 →