News for hackers. Stuff that matters.
Re:Modern garbage collection by tomp on Tuesday December 20, 2016 @12:33PM (#13221938)
Experience (i.e. the number of memory-related bugs) suggests otherwise.
Re:Modern garbage collection by wangchow on Tuesday December 20, 2016 @12:45PM (#13222064)
What about smart pointers? It gives the flexibility and benefits of garbage-collection without the performance degradation. It's not a silver bullet but it helps.

What I'm getting at is, Rust is the only modern language (in vogue at the moment) that does not use garbage collection. It would be nice if more languages didn't require a garbage collector but gave the option to use one.

If there are some more of such languages please chime in and provide a link to them! :)

Re:Modern garbage collection by tomp on Tuesday December 20, 2016 @01:57PM (#13222778)
> flexibility and benefits of garbage-collection

Not really, as it doesn't allow/collect cycles.

> without the performance degradation

Only for single-threaded code.

I agree with the rest of your comment!

Re:Modern garbage collection by prodigal_erik on Tuesday December 20, 2016 @04:20PM (#13224129)
A smart pointer is just a way to add custom behavior when it's created and destroyed. The question is what the smart pointer does. Usually the answer is update a reference count, which happens so frequently that it ends up being a lot more expensive (especially in bus bandwidth) than occasionally tracing live objects between long periods of useful work.
Re:Modern garbage collection by mike_hearn on Tuesday December 20, 2016 @04:00PM (#13223916)
D has optional GC. However in hindsight it is perhaps not so smart. The problem is that it fractures the ecosystem: some libraries require GC and others don't. If you don't want to use it you have to rely only on non-GC libraries.
Re:Modern garbage collection by user5994461 on Tuesday December 20, 2016 @06:30PM (#13225367)
Smart pointers are as hard to manage as pointers.

There are different kind of smart pointers and you gotta think what you want to do with them. A GC is easier.

Re:Modern garbage collection by wangchow on Wednesday December 21, 2016 @01:00PM (#13231134)
GC is certainly easier. However, it is important to understand the life-cycle of objects regardless. To be able to control them (if desired) is good because in many cases one would prefer to have that control instead of being forced to use garbage collector.

In an ideal world, garbage collector makes sense because we don't want to have to worry about life-cycle management when we are solving other problems. Memory management can indeed be an annoying implementation detail, but as it stands there are certainly limiting factors in hardware which are impacted by generic object-management for specific application domains.

Re:Modern garbage collection by topspin on Wednesday December 21, 2016 @03:25AM (#13227619)
GC isn't the the only way to achieve memory safety.