Type-based RC vs tracing GC strategy

25 views
Skip to first unread message

Jon Harrop

unread,
Oct 29, 2018, 1:28:18 PM10/29/18
to pragmatic-functional...@googlegroups.com

Hybrid GCs exist but the only ones I am aware of use generational collection for young values and RC for the old generation.

Given the relative strengths and weaknesses of RC vs tracing, it might be interesting to reserve tracing GC for values of mutually-recursive types and RC for references between sets of non-mutually-recursive types. There would be no need for cycle detection because the types guarantee the absence of cycles between reference counted values (they are not recursive). In concert with unboxed tuples, records and non-recursive unions this strategy might yield better results (less floating garbage and better performance).

Another strategy of interest might be to bake the concept of unrolled purely functional collections into the type system so that, for example, a recursive data type can specify a maximum level of recursion. This would aid the optimiser in choosing the most efficient representation for values of a given type.

Reply all
Reply to author
Forward
0 new messages