> To make fast GC it needs to be generational, but generational GC means write barriers: you can't just freely mutate memory, every pointer mutation must be accompanied by additional bookkeeping.
I guess that in the context of D generations are not possible or practical. If you have any idea why it should be possible, you may write a DIP.
I'm skeptical, however, if it will offer a real improvement.
Yes but what when it leaves it?
You have to update all pointers to another location.
When it passes to the Gen2 slab all references that point to it need to be updated, and those changes need to propagate to all threads, and all cores. The simplest way to do this is a memory barrier.
Well the real simplest way is just "never multi-thread" and this is OCaml's GC is so fast. No write barriers, 1 thread only, final destination.
No, for two reasons:
1. Write barriers are not necessary if an object is in a nursery, which is true for most objects per the generational hypothesis. This is trivial to check based on the pointer value.
2. You can have thread local remembered sets.