2 ms·
Is CPython the only widely-used language implementation that uses reference counting rather than tracing garbage collection? IIRC even PyPy and MicroPython use
by pansa2 5y ago
Is CPython the only widely-used language implementation that uses reference counting rather than tracing garbage collection?
IIRC even PyPy and MicroPython use tracing GC.
- MichaelMoser123 5y agoperl5 uses reference counted garbage collection (since perl 5.8 - came out in 2002). They avoid the GIL by having a seperate interpreter instance per thread https://perl.mines-albi.fr/perl5.8.5/5.8.5/sun4-solaris/threads.html#description https://perl.mines-albi.fr/perl5.8.5/5.8.5/sun4-solaris/thre... If you want to share variables between threads, then they have to be marked as shared https://perl.mines-albi.fr/perl5.8.5/5.8.5/sun4-solaris/threads/shared.html https://perl.mines-albi.fr/perl5.8.5/5.8.5/sun4-solaris/thre...
- rzimmerman 5y agoObjective C does (explicit) reference counting, though I suppose that's a pretty limited use case these days.
- loeg 5y agoDoesn't Swift (built on ObjC) also use reference counting?
- sgerenser 5y agoYes, Swift uses refcounting.
- pansa2 5y agoDoes Swift have a GIL? If not, how does it solve the problem of multithreaded reference counting?
- loeg 5y agoPer earlier comment[1], Swift uses the biased refcounting approach Gross is proposing for Python. [1]: https://news.ycombinator.com/item?id=28882299 https://news.ycombinator.com/item?id=28882299