2 ms·
We’ll see if they were the best, but they certainly weren’t the most advanced. (Not necessarily a bad thing!) For example, Mezzo[1] tracks memory allocations in
by mananaysiempre 4y ago
We’ll see if they were the best, but they certainly weren’t the most advanced. (Not necessarily a bad thing!) For example, Mezzo[1] tracks memory allocations in its type system in a manner very similar to Rust, but has absolutely no problem with circular or doubly linked lists. It also has a grand total of two people backing it and seems mostly dead.
[1] https://protz.github.io/mezzo/ https://protz.github.io/mezzo/
- Rusky 4y agoI 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...