Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Second Golden Spike: Memory Safety Across the Valen/Rust Boundary

The Golden Spike article introduced the concept of directly calling Rust functions from Valen, a new programming language that can seamlessly integrate with existing Rust code. This integration allowed Valen to implement Nick Smith's Group Borrowing memory safety approach, which differs from Rust's traditional borrow checking by relaxing the shared-xor-mutable restriction.

This means that Valen functions can now have multiple mutable references to the same object, a capability that was previously not possible in Rust due to its strict borrow checker. Group borrowing achieves this by tracking invalidation and allowing the compiler to know when two references might be pointing at the same thing, ensuring that references are not used after they become dangling.

The surprising part of this implementation is that Valen can also use group borrowing with Rust objects, allowing for multiple mutable references to such objects while maintaining memory safety. This is made possible by the temporary unique references and noalias concepts, which help maintain the distinction between shared and unique references while enabling safe interaction with Rust code.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at verdagon.dev →

More in Tech

More from Thursday 1 October →