News for hackers. Stuff that matters.
Re:Which language has the brightest future for replacing C: ... by mondoshawan on Wednesday November 11, 2015 @08:22AM (#10546514)
If you throw an exception, what would the resulting recovery mode even /be/, aside from clearing out unused memory (never mind that just finding all of your allocations is a nightmare in and of itself)? And how would this actually work in a non GC world where functions can allocate and free at any time -- ie, you are working on a team and can't know the state of every thread, task or chunk of code at once?
Re:Which language has the brightest future for replacing C: ... by quotemstr on Wednesday November 11, 2015 @08:54AM (#10546636)
> If you throw an exception, what would the resulting recovery mode even /be/

Unwind the stack and present an error message or take other appropriate action, just as we would for any other error. By unwinding the stack, we release owned resources, and some of those resources happen to be memory blocks. What makes memory so special?

> just finding all of your allocations is a nightmare in and of itself

Huh? In a non-GC system, if you can't find your allocations, you're leaking memory.

Re:Which language has the brightest future for replacing C: ... by mondoshawan on Wednesday November 11, 2015 @09:27AM (#10546786)
My point about finding the allocations is actually a bit poorly put: not all parts of your program may be ready to release memory it has held without losing user data in the process.

Memory is special insofar as it is a core resource that has so much contention that OOM situations may not be directly because of your application, and recovery may not even be possible without allocation.

I'm slowly coming to realize my argumentative point is losing ground -- this is great! :-)