4 ms·
Reference counting is already slower than having a GC in most practical applications, not to mention that having no circular references may make the code where
by chmod775 8y ago
Reference counting is already slower than having a GC in most practical applications, not to mention that having no circular references may make the code where you need 'em either slower or means you'll have to write a workaround, which is often also overhead and makes things more complicated.
- tjoff 8y agoThe benefit of not using GC is improved understanding of the code and a better architecture. These things will also lead to better performance. GC was a mistake. The main reason it is still used outside scripting languages is the notion that non-GC languages need to be low level. Which in practice is kind of true just because we haven't had any real competition in that area.
- hasahmed 8y agoGc was a mistake? On what possible authority can you make such a claim?
- tjoff 8y agoIt's not that controversial of a statement. The choice has largely been dictated by the fact that non-GC meant C or C++, and it is not hard to find reasons to avoid them. Now we also have rust, but rust is new and also has a low-level aura, making comparisons to high-level languages difficult. That Go has a GC is a shame, such a missed opportunity.
- p_l 8y agoNot having GC in no way improves understanding of architecture or gives better performance. Hordes of C/C++ programmers that don't understand memory management but swear by malloc()/free() are a good example of that. And it's not like C/C++ are only language without GC, they are just popular now. Typical programmer is taught nothing about memory management, till maybe they learn bits and pieces (often by hearsay and cargo culting). It doesn't matter if we're talking manual or automatic. Without such understanding one cannot write performant code or make a good architecture. Also - a good working definition of low-level language is language that makes you care about things irrelevant to your task...
- tjoff 8y agoNot necessarily no. Just as having type information doesn't lead to a better program. But it helps. And is something you need to reason about regardless. Being explicit about it isn't a huge overhead but has lots of benefits.