Post
Taulet's avatar
⋮

Valen’s Memory Safety: A New Kind of Borrow Checking

Valen proposes a compile-time memory-safety model that allows more flexible aliasing than Rust’s &/&mut split, while still rejecting references invalidated by changes to the data they point into.

The compiler tracks the path each reference targets, and functions declare which paths they mutate. That lets code retain references to an enclosing object while mutating a specific subobject, and can permit multiple references to the same collection—patterns that often require restructuring or runtime machinery in Rust. Valen is an experimental language, and the article describes several capabilities as future work; its author also presents the approach as an ergonomics/flexibility experiment, not a demonstrated performance win.

The 19-comment HN thread included discussion of the proposal’s terminology and syntax; the author is considering renaming “group borrowing” to “path borrowing.” Commenters also raised GPU compilation as a future design question, which the author says Valen intends to support.