3 ms·
I can. Do you consider Rust not modern? Destructors are usually hard to support cleanly in the presence of obligate GC. Given destructors, GC turns out to be u
by ncmncm 6y ago
I can. Do you consider Rust not modern?
Destructors are usually hard to support cleanly in the presence of obligate GC. Given destructors, GC turns out to be unnecessary. Lacking destructors, managing non-memory resources becomes foolishly difficult, particularly across library boundaries.
- arakov 6y agoas much as I can see, Rust is a special case. So I mean most of the modern languages. After all I consider C++ modern as well :)
- ncmncm 6y agoOK then! I will be interested to see how destructors are reconciled with GC. Where I have seen GC used in C++ runtimes, it is confined to specific, graph-like structures, where tracking cycles would be messy; or provided to obligate-GC languages being interpreted. In both cases it is always clear whether an object's lifetime is tracked, and the C++ runtime does not see the objects.
- arakov 6y agoI know there are problems with destructors. That's why I didn't implement them yet. But in C# they do exist. And after all you may always use explicit finalizers. I don't think that it makes the concept of obligate-GC invalid. But after all I don't care much. I'm more interested in other parts of language designs :)