| ▲ | pklausler 4 days ago |
| It could be made to work in a language like Haskell, where cyclic structures can arise only in limited circumstances (recursive `let` groups) and can be given a distinct runtime representation. |
|
| ▲ | comex 4 days ago | parent [-] |
| Well, if everything is immutable like in Haskell, then you don't really run into the problems described in the blog post in the first place. You can live with Rust's "no mutable aliasing" rule instead. |
| |
| ▲ | pklausler 4 days ago | parent [-] | | Obviously; but the point was, if the language were to limit the circumstances in which circular structures can arise, one could exploit that fact. | | |
| ▲ | gf000 4 days ago | parent [-] | | I was thinking that the type system can in certain cases determine that no circular reference is possible for an instance of this type - in that case it could e.g. use an RC (for a region only having that type of objects), and fallback to either an arena-like pattern of freeing everything at once (if only internal circular references exist), or a tracing GC. |
|
|