Higher ranked region inference for compile-time garbage collection
Summary
In many languages, memory is managed by a garbage collector. Region based memory management forms an alternative and is used in the Rust and MLKit compilers. Most of the work is done ahead of time, by splitting the heap into regions, which have a lexical lifetime. Whereas Rust forces the programmer to write region annotations, they can be automatically inferred in MLKit using a type and effect system.
To improve the accuracy and reduce poisoning, we designed a higher ranked region analysis. We implemented this in the Helium Haskell compiler, such that we can analyse a real world language like Haskell with higher-rank precision. Furthermore, this will give us insights in the integration of regions with other optimization passes.