6 ms·
I think all this time spent over the last 50 years trying to improve GC were a kind of sunk-cost fallacy. Instead of answering the question "how do we make GC b
by arcticbull 11y ago
I think all this time spent over the last 50 years trying to improve GC were a kind of sunk-cost fallacy. Instead of answering the question "how do we make GC better/faster/less laggy/take less memory/not freeze the world/be more deterministic" people should have been investing in "how do we elide object lifetimes so programmers don't have to think about them."
Especially since GC doesn't map to the real world in important ways, for instance OS resources such as sockets/threads/pipes/files. You have to build your own reference counting on top of these things anyways.
This is why I have a lot of hope in Rust -- not necessarily because I see it as the ideal, rather because they are asking the latter question and they've got some pretty cool results.
It's time to let go of 'GC' in the classic sense and figure out how we can elide object lifetimes in a clean, rational and deterministic way.
- wtetzner 11y agoWell, you can't always know the lifetime of an object until runtime, especially in multithreaded situations. There are plenty of reasons to want to work on being able to determine object lifetimes at compile time, but I don't think that work would actually replace what a GC would give you. I think the future will likely be some combination of both.
- dboreham 11y agoI wish I could upvote this 10 times. In C the programmer has to manage memory which is a chore, but the programmer can do it because they _know_ something about the lifetime of their data. In GC languages that knowledge is sent to /dev/null, then heroic efforts are expended to attempt to machine-re-lean it again at runtime. This is crazy. As you observe, the better plan is to relieve the programmer of the chore of manual management, but do while retaining their knowledge and understanding of the behavior of their code.
- deleted 11y ago[deleted]