While implementing SRFI 254 for Larceny, I discovered that SRFI
254, as written and finalized, assumes a garbage collector that
either collects the entire heap all at once (such as a stop and
copy collector) or behaves as though it were a younger-first
generational collector.
Even worse: It looks to me as though SRFI 254 is not only
incompatible with Larceny's regional collector, but is also
incompatible with most of the younger-first generational
collectors in use today.
Some history: SRFI 254 was inspired by a Scheme workshop paper
that explicitly assumed the garbage collector is a conventional
younger-first generational collector [1]. By the late 1990s,
a number of researchers had proposed, and a few had implemented,
generational collectors that are not younger-first. Lars Hansen
had implemented an older-first generational collector for Larceny
by 2000, and several other generational collecctors were added
to Larceny over the course of the next several years. By 2011,
Felix S Klock II and I had published three papers describing and
evaluating Larceny's regional garbage collector [2]. Since 2009,
all releases of Larceny have provided a regional collector, and
that regional collector is still the most sophisticated of the
three garbage collectors available to programmers who use recent
releases of Larceny.
The SRFI 254 discussion archive records several posts from 15
August 2025 that, implicitly or explicitly, assume younger-first
generational garbage collection [3,4,5,6,7,8].
On 8 January 2026, Marc Nieper-Wißkirchen announced the following
change to his draft of SRFI 254:
I have added the following language to my local draft:
"If an object obj1 denotes a location holding an object obj2
that is moved, the object obj1 is moved as well."
As discussed in this thread, this does not but a burden on
implementers but enables the use case of compound keys with
some fields having unstable hash values.
With most generational collectors, the quoted sentence that was
added at that time is simply false. If we were to take that
sentence as nothing more than the author's misunderstanding of
generational garbage collection, then we could just ignore its
presence within SRFI 254. Unfortunately, the finalized SRFI 254
says that sentence is a stipulation:
Finally, [SRFI 254] stipulates that objects may be moved in
the course of a computation with the following restrictions:
1. If an object obj1 is moved, every object obj2 such
that eq? returns #t when applied to obj1 and obj2 is
moved as well.
2. If an object obj1 denotes a location holding an object
obj2 that is moved, the object obj1 is moved as well.
If we take that second condition seriously, then SRFI 254 cannot
be supported by implementations of Scheme that use conventional
younger-first garbage collectors, and it most certainly cannot
be supported by implementations of Scheme that use even more
sophisticated collectors such as Larceny's regional collector.
I propose we add a post-finalization note that says the second
condition quoted above should either be ignored or, if not
simply ignored, should be interpreted in some way that allows
implementations that rely upon generational collectors (whether
younger-first or otherwise) to support SRFI 254.
William D Clinger
[1] Abdulaziz Ghuloum and R Kent Dybvig.
Generation-Friendly Eq Hash Tables.
Proceedings of the 2007 Workshop on Scheme and Functional Programming.
Universit´e Laval Technical Report DIUL-RT-070.
https://www.schemeworkshop.org/2007/procPaper3.pdf
[2] https://larcenists.org/research.html cites these papers.
[3] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32010076/
[4] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32015768/
[5] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32016328/
[6] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32016704/
[7] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32016854/
[8] Marc Nieper-Wißkirchen, 15 August 2025.
https://srfi-email.schemers.org/srfi-254/msg/32018526/
[9] Marc Nieper-Wißkirchen, 08 January 2026.
https://srfi-email.schemers.org/srfi-254/msg/35933289/