r/ProgrammingLanguages • • 24d ago

Safe Systems-programming with Mutable Value Semantics | Dave Abrahams | Keynote at IWACO 2026

https://youtu.be/op51SyyPJmw?si=P5QH6M8Hdf4_CUUZ
36 Upvotes

12 comments sorted by

View all comments

6

u/processeus1 24d ago

I'd be curious to hear if anyone has use cases where saved references are necessary and cannot be replaced with another design pattern using value semantics without significant loss of efficiency or correctness safeguards.

As a starter: one example would be to project an optional out of a map to access its element at a key, but we can fix that issue with subscripts that yield 0 or 1 times, and allowing the caller to directly pattern match on the result. This works, because we don't need to save the "optional" for longer period.

2

u/Jolly-Bag7024 22d ago edited 22d ago

It's a fake debate.

If you are basically rebuilding mutations in your new value based system, you have just moved the issue one abstraction layer above.

What's interesting is then what this new abstraction layer provides and costs. Looking at it through the lens of removing references is nearly always the wrong way to think about it conceptually.