[MLton] regions

Stephen Weeks MLton@mlton.org
Thu, 30 Sep 2004 11:25:35 -0700


> Is there an implementation of region-style memory management (like
> the ML Kit) for MLton?

No.

> In particular, given MLton's focus on performance, is there a
> particular reason why regions were not adopted as the primary
> mechanism for memory management?

The historical reason is that when MLton's collector was first built
in 1998, a stop-and-copy collector seemed simplest and fast enough (it
was), and none of us in the group were very familiar region-based
memory management.

I know more now, but am still no expert on regions.  My opinion is
that it is far from clear that regions will provide MLton with
improved performance, they add a lot of complexity to the compiler,
and they complicate reasoning about and achieving about space safety,
which we do care about and is difficult enough to achieve as it is.

There are a couple of others on the list (Dan Wang, Matthew Fluet) who
surely know more about regions that I.  Hopefully they have something
to add.