Hacker News new | ask | show | jobs
by egnehots 762 days ago
I think that an easy-to-implement and reasonably performant garbage collector (GC) would combine two approaches:

- Let the compiler automatically free variables that go out of scope (using static analysis to insert free calls).

- Use reference counting when the scope is too hard to determine (fall back on a dynamic check).

2 comments

Static analysis isn't easy, though.
I'd like to add using tracing when the references might cause a cycle (statically analyzed?).