3 ms·
Apparently, Python split the difference and uses reference counting alongside garbage collection: https://rushter.com/blog/python-garbage-collector/ https://ru
by msla 4y ago
Apparently, Python split the difference and uses reference counting alongside garbage collection:
https://rushter.com/blog/python-garbage-collector/ https://rushter.com/blog/python-garbage-collector/
However:
> I'd say that Borrow Checker is still manual memory management, except the compiler writes the free() for you.
And:
> #4: purely declarative languages and such is going to be garbage collected in practice.
My point is to catalog the different ways programmers have to think about resource usage, not implementation details. Python is a GC'd language, and unlike C++ with smart pointers, because it doesn't make the programmer manually manage memory in order to avoid a leak, and regular expressions and SQL are high-level in that the languages don't even offer a way to express the concept of resource management.
- Jtsummers 4y ago> Apparently, Python split the difference and uses reference counting alongside garbage collection: Splitting the difference between what? Both reference counting and generational garbage collection algorithms are garbage collection algorithms. The generational garbage collection algorithm is to handle issues with things like cyclic references (A->B, B->A) which would cause a pure reference counting garbage collector to retain the memory even if nothing else referenced A or B.