

Ask HN: Why garbage collection? - chrisdew

C programmers (myself included) can often write correct programs with manual memory management (malloc/free).<p>Why can't a sufficiently capable compiler/language manage its memory based on static analysis of a program?  (i.e. insert its own 'free's where a programmer would have put them)
======
div
They can, and it's basically what LLVM does when you turn on ARC for your
Objective-C program.

[http://stackoverflow.com/questions/6385212/how-does-the-
new-...](http://stackoverflow.com/questions/6385212/how-does-the-new-
automatic-reference-counting-mechanism-work/6418410#6418410)

~~~
chrisdew
Read all about it and it seems to just be reference counting :-( Not as
exciting as it seemed.

~~~
allwein
Well that's kinda in the name. ARC = Automatic Reference Counting.

Besides, who's looking for exciting? It's freedom from stupid memory errors.
That's awesome!

