Ante, a low-level functional language with ownership and borrowing similar to Rust, reworks borrow checking to permit safe shared mutability and cyclic data structures without runtime cost. The core insight is shape stability: some references (e.g., to unboxed tuple fields) remain valid under mutation because the underlying memory layout can’t change, while others (e.g., references into a vector’s heap buffer) can become dangling when the container is mutated. Earlier Ante rules using “local uniqueness” and a Distinct constraint were flexible but brittle (private-field breaks, confusing conversions, type-frequency bias), so the design was replaced with a more precise model that reasons about exact borrow targets.
Instead of lifetimes, the checker tracks places - concrete sets of locations a reference may borrow from (like 'x, '(x,y), or fields 'z.bar). Places can be marked unstable with ! to indicate they may be invalidated by mutations; mutating a place invalidates its unstable variants (a!), and multiple unstable borrows can coexist so long as no operation requires a stricter stability (a!!). Unstableness is inferred for collections and tagged unions, letting formerly rejected but safe patterns pass (e.g., simultaneous first_mut/last_mut). Loops and closures follow familiar ownership rules (mutations inside loops can invalidate outer borrows; closures that invalidate captured state are FnOnce), callers must satisfy exclusivity constraints where needed, and the design preserves thread-safety and safe cyclic mutability while avoiding the prior design’s breaking and usability problems.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.