Re:Algebraic Effects, Ownership, and Borrowing
by SkiFire13 on Wednesday February 21, 2024 @05:00PM
(#39460238)
Rust does have something equivalent to what's described in the article you linked (and in fact the article even cites it): `&Cell<T>`. It does have some drawbacks compared to what's described in the article though (e.g. no built-in field projection, but it can technically be added in a future compiler version). It is also not completly free: it requires custom implementations of `Clone` to be `unsafe` (in Rust this is equivalent to the fact you cannot clone the `T` inside a `&Cell<T>`, this could also be fixed with an `unsafe trait`). Overall the idea is nice though and I'm curious to see how it will turn out in practice.
[ Parent
| on HN ]
Re:Algebraic Effects, Ownership, and Borrowing
by Rusky on Wednesday February 21, 2024 @08:02PM
(#39461796)
Ante has a similar unresolved problem with Clone- AIUI you can only safely Clone things you can project a `&shared` reference through.