Shallow-bind symbols? #24
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: simon/post-scarcity#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm not convinced I want to abandon deep binding altogether, but there's no doubt that shallow binding is (much!) faster1. So I want to have shallow bind symbols. Whether they should replace the existing symbols, or supplement them, is at present an open question. But it does mean that symbols need meta-data, to whit at least whether they are shallow-bind or not (this is the meta-data added by
(declare special...))in Common Lisp. Which means they cannot fit into the memory footprint of apso22; which means, in turn, that there would be merit in storing them as character arrays inpsonobjects, which would require much less chasing of pointers.See:
OPERATION;
Is this actually true? To have shallow binding work, you have to ensure that there are not two distinct symbols in the environment which are lexically identical but have different bindings. Which means every time a symbol is read, you need to see whether or not that lexical sequence of characters is interned in the environment, which is precisely what you'd have to do for a deep bound symbol anyway. ↩︎
It would of course be possible to store a symbol as a
pso2whose first pointer was a pointer to metadata, and whose second pointer was a pointer to the string which represented the print name of the symbol, but that feels pretty messy. ↩︎