4 ms·
Ask HN: Why garbage collection?
C programmers (myself included) can often write correct programs with manual memory management (malloc/free).
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 15y agoThey 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-automatic-reference-counting-mechanism-work/6418410#6418410 http://stackoverflow.com/questions/6385212/how-does-the-new-...
- chrisdew 15y agoThanks, that's really interesting.
- deleted 15y ago[deleted]
- chrisdew 15y agoRead all about it and it seems to just be reference counting :-( Not as exciting as it seemed.
- allwein 15y agoWell 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!