3 ms·
I wouldn't say "absolutely no problem." Based on section 2.5 of [1], Mezzo needs some extra bookkeeping to handle reference cycles as well- the program needs to
by Rusky 4y ago
I wouldn't say "absolutely no problem." Based on section 2.5 of [1], Mezzo needs some extra bookkeeping to handle reference cycles as well- the program needs to select a single owner for objects involved in cycles, and `give`/`take` them to/from that owner to access them, which can fail at runtime.
Section 2.6 describes a static variant of the same idea, named `focus`/`defocus`, which can't fail at runtime but has some limitations on how nodes can be used.
These don't exactly match the solutions Rust typically uses, but they are close to a few of them in several ways. This looks more like a question of defaults and API (including the choice to rely on garbage collection by default) than the design of the type/borrow checker.
[1] http://gallium.inria.fr/~fpottier/publis/bpp-mezzo-journal.pdf http://gallium.inria.fr/~fpottier/publis/bpp-mezzo-journal.p...