SBCL uses a single zero bit to tag integers. This trick means the representation of n is just 2n, so you can add the values directly without any decoding.
It obviously also means that all the other tag values have to use 1 as the last bit.
FYI thecloudlet, the last quote from a Reddit user at the end seems to have duplicated content (copy-paste error?)
I read both articles and am looking forward to your next! I’d be interested in understanding more about the relationship of EMacs to GCC since you noted the authors were the same and the internals were written with some compiler awareness.
Symbols are just list of numbers. Variable is just a nameless place in memory, but often associated with a symbol.
Numbers in symbols are printed out as ASCII-characters when it seems appropriate, like after SETQ.
Or we could decide that number-list that ends with 0 and contains only range(0x21,0x7F) is printed out as symbol. Does not matter, it is just syntactic sugar.
And We do not need strings for much anything. We could of course decide that number-list with ord('"') is printed out as string. The reader could also follow this protocol.
I had all this figured out at one time. And I dont remember any major issues. B-)
7 comments
[ 163 ms ] story [ 3573 ms ] threadIt obviously also means that all the other tag values have to use 1 as the last bit.
I read both articles and am looking forward to your next! I’d be interested in understanding more about the relationship of EMacs to GCC since you noted the authors were the same and the internals were written with some compiler awareness.
Symbols are just list of numbers. Variable is just a nameless place in memory, but often associated with a symbol.
Numbers in symbols are printed out as ASCII-characters when it seems appropriate, like after SETQ.
Or we could decide that number-list that ends with 0 and contains only range(0x21,0x7F) is printed out as symbol. Does not matter, it is just syntactic sugar.
And We do not need strings for much anything. We could of course decide that number-list with ord('"') is printed out as string. The reader could also follow this protocol.
I had all this figured out at one time. And I dont remember any major issues. B-)