4 ms·
> I've been wondering lately whether a new spatial approach can yet again simplify matters. This is indeed the case! Rust's borrow checking is the first step t
by verdagon 4y ago
> I've been wondering lately whether a new spatial approach can yet again simplify matters.
This is indeed the case! Rust's borrow checking is the first step towards "regions", a more general and more flexible model. TL;DR: We convey to the compiler that a certain set of objects are conceptually in the same region, and then we can turn immutable the entire region at once.
Pony and Forty2 [0] first came up with them, and Vale is building them into the language as first-class citizens and blending them with borrow-checker like semantics [1] to eliminate memory safety overhead.
It helps us do patterns that more traditional borrow checking has trouble with: observers, dependency references, delegates, callbacks, some forms of RAII, and intrusive data structures. This is mostly because regions get a lot of the borrow checker's benefits while still allowing mutable aliasing.
[0] http://forty2.is/ http://forty2.is/
[1] https://verdagon.dev/blog/zero-cost-memory-safety-regions-part-1-immutable-borrowing https://verdagon.dev/blog/zero-cost-memory-safety-regions-pa...
- eternalban 4y agoVery cool. I will take a look. This * was a (just) sketch I did years ago starting from a CSP base (Go). Explicit spaces (or "regions") and defined transition semantics (which compiler and runtime can enforce and guarantee). Single ownership spaces also make distributed GC so much simpler. *https://github.com/alphazero/csp-cso-chipmunk- https://github.com/alphazero/csp-cso-chipmunk-