[CM] Idea: using handles instead of pointers, s7_clone

Kjetil Matheussen k.s.matheussen at gmail.com
Mon Sep 26 08:41:12 PDT 2022


Hi Christos,

Thank you for bringing up the topic and for creating an interesting discussion.
My thought is that using handles (or pointers to pointers) gives a lot
of possibilities to automatically
compact memory or improve the garage collector in various ways, maybe
so much that it's
worth the cost of handling the handlers.

For instance, one thing that supposedly (and probably also in reality)
sets down the performance of Lisp,
is the extensive use of linked lists instead of vectors. By using
handles (or pointers to pointers), it's probably
possible some way to rearrange the memory so that it looks like a
linked list on the outside.
For example by using another bit for tagging. If this bit is 1, the
"cadr" element of a pair would
be positioned on the next memory.

Although CPU caches are large in current computers, you always risk
cache misses, and especially in a library that is meant to be used as
an extension language.


More information about the Cmdist mailing list