Proof automation in a language
The wire material discusses proof automation and its potential impact on software quality and understandability. The author explores how proof automation can be used to write large amounts of code and improve software understandability. They mention various ideas in programming language design, noting that their viability can change as cost structures evolve.
The author introduces the concept of value semantics, which prevents observing mutations to one variable through a different name. They explain that value semantics is beneficial for local code reasoning, as it allows readers to focus on local effects without worrying about non-local consequences. However, as the scope of sharing increases, the mental complexity grows.
The discussion then shifts to functional programming, where mutation is eliminated to simplify code understanding. However, the author highlights that mutation is crucial for efficiency, and finding a balance between the two can be challenging. They mention Lean, which performs in-place mutations for single-reference objects, but warns about the potential for hidden references and performance crashes.
The author introduces Mutable Value Semantics (MVS), which restricts references and prevents them from being part of the type system. MVS systems avoid the complexity introduced by Rust's borrow checker, lifetimes, DerefMut, and similar mechanisms. The author suggests that MVS systems can provide an alternative to references by allowing functions to take immutable, mutable, and owned arguments.
Hylo, a language following MVS principles, is introduced as an example. It uses scoped coroutines to address the issue of returning or storing references, which would otherwise require complex pointer-based solutions. The author notes that while coroutines are useful, they make the semantics more complex, and they have not included them in their experiments due to the budget spent on verification.
Finally, the author connects MVS ideas to formal verification. They mention that formal verification on languages like C requires modeling the heap and dealing with aliasing issues through separation logic. However, they argue that restricted references can reduce complexity in formal verification systems, such as Aeneas/Charon, which translates Rust code into Lean without needing a separation logic.
Rewritten by urgent.news; may contain errors — check the original.
Source: imperialviolet.org