Aaron Sloman comments that:
> I fear that as regards Poplog there's too much low level stuff in the
> system and in libraries that generates garbage (e.g. the interfaces to X
> and its utilities, and even the opening of device records for reading
> and writing to pipes and files, etc.) for it ever to be possible to
> ensure that one's code runs in garbage-free fashion in all applications.
These procedures allocate store but do not necessarily generate
garbage (though some do, of course). For examples, creating a device
record uses store but, provided it is later freed, there should not
be any garbage created. The obvious complication is that the device
record points to internal data structures that would also have to
be freed. In short, the to-be-invented procedure -sys_free- has to
be type-sensitive so that internal, private data structure can be
disposed of along with the main data structure.
(Device records are an interesting case in point because of the
existance of device_user_data. The user data should probably be
disposed of along with the device but that creates its own risks.)
My own experience in programming in Poplog is that garbage-free
programming is difficult but not impossible. There are a few
"gotchas" that are unexpected. One example is the fact that deleting an
entry from a property (hash-table) creates garbage because
property entries are not held on a free-list. This arises,
presumably, because property entries became exposed when
-fast_get_prop_entry- became published. [Personally, I believe that
it is reasonably to return deleted property entries to a free list
and, thus, avoid generating garbage. Programs that hold onto property
entries should be send to bed without any supper!]
Steve
|