2 ms·
I don't think constructors are the challenging part. It's about lexically scoped destruction. Certainly there are languages that have that and permit garbage co
by fweimer 2y ago
I don't think constructors are the challenging part. It's about lexically scoped destruction. Certainly there are languages that have that and permit garbage collection, however those constructed values are necessarily second-class citizens and behave somewhat differently than ordinary values. There's probably some reasonable middle-ground, like constructors returning an owned reference that explicitly can be turned into an unowned reference, thus opting out of deterministic destruction.
- pjmlp 2y agoAnd those languages do offer lexical scoped destruction. They are only second class in the context people put all GC languages on the same basket, and rather go for the X rewritten in Y blog posts. Because apparently adding newer languages to CV is cooler than mastering the one they have.