29 ms·
PS: There are a couple of extremely minor things I've come across that I'd consider correcting. Do you care for those? If so, github pull request? I'll give an
by smueller1234 9y ago
PS: There are a couple of extremely minor things I've come across that I'd consider correcting. Do you care for those? If so, github pull request? I'll give an example below.
IIRC you say that all non-trivial interpreters have abolished ref-counting and usually using some mix of tracing and ref-counting (o//r just tracing GC). Your example for an interpreter that was using ref-counting is Ruby.
The example of a non-trivial interpreter that continues to be fully ref-counted is perl.
[rant]Worse yet, perl goes fast and loose in one edge case: it eschews ref-count operations on values on argument stacks, which is a source of bugs that couldn't be more hilarious.
So yeah, perl doesn't detect cycles. It's really quite sad. It's also not fundamentally impossible to add in a tracing GC for detecting cycles. But it'd be a reasonably daunting task given the code base.
I've occasionally thought about whether it's possible (and if so at what cost) to move perl (5) away from ref-counting. Perl (the language) happens to give strong guarantees about when objects are destroyed / hooks are triggered, and that's commonly relied upon in RAII-like use cases.[/rant]