Some time ago, in the summer after Rust went 1.0, I started a personal project to explore garbage collection in Rust. I stopped working on that project earlier this year but for anybody who might interested, I wrote up my experience here. The summary reads:
Mo-gc is an experiment in garbage collection written in the Rust programming language.
Instead of scanning the stack, the mutator writes reference count increments and decrements to a journal. The journal is read concurrently by a garbage collection thread that keeps a map of objects and their absolute reference counts. The object map is divided into young and mature generations and collection is done with parallellized mark and sweep phases.
The journal is a type of snapshot-at-beginning write barrier and this project was an experiment in the feasibility, limitations and scalability of this approach.
In brief conclusion, this project was ambitions and fell short but I learned some of the hard lessons of garbage collector implementation.
This article traces my thought process and implementation from beginning to time of writing.