Christine Lemmer-Webber schreef op wo 08-09-2021 om 12:18 [-0400]: > Maxime Devos writes: > > > [[PGP Signed Part:Undecided]] > > Maxime Devos schreef op zo 20-06-2021 om 17:01 [+0200]: > > > Christopher Lemmer Webber schreef op di 18-05-2021 om 11:46 [-0400]: > > > > Hello, > > > > > > > > I'm finally taking some time to port Goblins to Guile, in-between other > > > > tasks anyway. In Goblins there is a weak hashtable that maps current > > > > actor references to their current behavior. I found that for > > > > self-referential actors, I needed ephemerons for GC stuff to work right. > > > > > > [bla bla on how this could be implemented in Guile] > > > > This doesn't work because there is nothing preventing the > > 'value' from being freed. Trying to fix that now, using > > the example implementation of "weak maps" in libgc. > > > > Greetings, > > Maxime. > > I fell off the radar on replying to this, but did path turn out to work? The example implementation was a bit complicated and not well-documented. The ‘disclaimer’ support is disabled by default, a configuration flag needs to be set while compiling libgc to use disclaimers. Guix (the distro I use) doesn't set it. I needed to be careful in libguile/weak-table.c to not protect too much (otherwise it wouldn't be an ephemeral weak hash table) or too little (otherwise ‘freed’ objects would be re-used). I think it can be made to work, but I didn't succeed, and moved on to other things. If someone would like to implement this, I would recommend starting with something like ‘ephemeral pairs’ before moving to ephemeral hash tables. Greetings, Maxime.