eashanhatti/peridot

Memory Management

eashanhatti opened this issue · 2 comments

Considering memory management options at the moment.
On the table:

  • Tracing GC
  • RC

Off the table:

  • Regions. Region inference becomes woefully imprecise in the presence of lazy evaluation, which Konna will use.

I'm thinking that we'll use a combination of RC and GC. The only strict limitation RC has is that it can't deal with cycles. So we can have two kinds of datatypes - strictly positive ones and ones without that restriction. The former can be managed by RC optimized along the lines of Lobster. The latter can be collected by a tracing GC.

Hmm, this is seeming like just a more complex version of RC + a cycle collector. We'll see where this goes

Enforcing strict positivity actually doesn't prevent cycles - recursive let bindings are what cause them, and I'd rather not give up that feature. Also, high throughput is important in lazy functional languages. I think I'll go with a tracing GC.