News for hackers. Stuff that matters.
Re:A Garbage Collector for C and C++ by amelius on Friday July 10, 2015 @03:46AM (#9862749)
> In particular, C++ (and Rust, etc.) stresses RAII (Resource Acquisition Is Initialization)

But there is no reason that the RAII pattern couldn't be completely orthogonal to memory management.

Re:A Garbage Collector for C and C++ by moonchrome on Friday July 10, 2015 @04:35AM (#9862865)
>But there is no reason that the RAII pattern couldn't be completely orthogonal to memory management

GC + destructors = very very messy even in languages built with GC in mind, kentonv described the whole non deterministic finalizers nicely but there are also other problems see here :

http://ericlippert.com/2015/05/18/when-everything-you-know-i...

Re:A Garbage Collector for C and C++ by ExpiredLink on Friday July 10, 2015 @04:16AM (#9862817)
Could. A hypothetical new language could be created to facilitate whole-program escape analysis and thus completely avoid both GC and manual memory (resource) management.
Re:A Garbage Collector for C and C++ by Others on Friday July 10, 2015 @09:30PM (#9868082)
This sounds awfully like the ownership concepts used in Rust...
Re:A Garbage Collector for C and C++ by kentonv on Friday July 10, 2015 @02:29PM (#9865801)
You could do that, but if you are using RAII, then GC has lost a lot of its value. It is incorrect to access an object after its destructor has executed, so you might as well release its heap resources then and ditch the whole complicated GC.

I suppose in theory you could use GC just for objects that (transitively) don't hold any non-heap resources. But that gets a little weird as if you ever device that you need to stick a non-heap resource in there, suddenly all your code needs to change. (Of course, this is already generally the case in GC languages...)