Re: Minimal keywords needed for constructing a full CL system



rpw3@xxxxxxxx (Rob Warnock) writes:
+---------------
| You don't need hash tables, but weak hash tables are very very handy,
| and I don't see how those could be implemented outside the core.
+---------------

Just curious... How are weak hash tables more useful than generic
weak pointers? [You need weak pointers for finalization, which I'll
grant can be useful.]

Some weak structures can be implemented above mere weak pointers, but
some other cannot. For example, weak-or-relation is primitive, you
cannot implement it with only weak-pointer.

Also, depending on the invariants you expect after a garbage
collection, you may need to implement the other weak structures as
primitives too.

For one thing, the unsuspecting garbage collector will collect only
the first layer of the weak pointer. The weak pointers that become
dead because of this first garbage collecting are not further
collected. So if you implement non primitive weak structures, you
need to run the garbage collector several times in a row to get the
same effect as with primitive weak structures. The situation is worse
with circular structures of weak pointer. As soon as it goes thru a
non weak structure such as a hash table (or merely a structure that
won't be normally garbage collected, because it's used), the weak
pointers won't die, and won't be collected. This is particularly true
with hash table, when the value contains a back reference to the weak
key: the weak key won't die, even if the only reference there is to it
comes from the value.

http://www.informatimago.com/develop/lisp/index.html#clext

Ad: The best weak structure support is in clisp!

--
__Pascal Bourguignon__ http://www.informatimago.com/
Kitty like plastic.
Confuses for litter box.
Don't leave tarp around.
.



Relevant Pages

  • ARP does not scale
    ... ARP has hash table and garbage collection scalability limitations. ... Related to scalability is the ARP entry garbage collector. ... entries becomes large, the amount of time spent processing all of the ARP ...
    (Linux-Kernel)
  • Re: CLOS and databases
    ... HHO> weak pointers, you could populate a hash table with weak pointers. ...
    (comp.lang.lisp)