r/ProgrammingLanguages • u/RishabhRD • 27d ago
Safe Systems-programming with Mutable Value Semantics | Dave Abrahams | Keynote at IWACO 2026
https://youtu.be/op51SyyPJmw?si=P5QH6M8Hdf4_CUUZ
36
Upvotes
r/ProgrammingLanguages • u/RishabhRD • 27d ago
3
u/tmzem 25d ago
The basic idea of value semantics is simple and easy to understand and reason about. However, the main issue are stored references/projections, which are necessary for many common patterns that project parts of an object/collection in a more general way:
Indexing-like operations that might fail: index_at(inout Container, let Index) -> Optional<inout Value>
Failable operations that might return projections: append_within_capacity(inout ArrayList<T>, sink T) -> Result<inout T, sink T>
Generalized slices: split_at_inout(inout ArrayList<T>, at_index: Int) -> Pair<ListSlice<T, inout>>
Any kind of iterators and iterator-adapters
Map entries returned from map data structure subscripts and map iterators need to be able to have stored projections: KeyValuePair<let K, inout V>
Rust also allows more complex patterns by allowing multiples paths/lifetimes per user-defined type, but those are rarely used and there is probably some explorable design space (or patterns) to do those cases in a simpler way.