It occurred to me, that I was told about Unison Lang recently and this language uses content addressable functions.
In other words, the code for a function is hashed and that is its identity that never changes while the program is running.
If we use the same approach with Python, each object could have a hash that corresponds to the code only, instead of the data. This is the objects identity even when added to the book keeping data of another subinterpreter.
This requires decoupling of book keeping information from actual object storage. But replaces pointers with lookups which could be inlined to pointer arithmetic.
In other words, the code for a function is hashed and that is its identity that never changes while the program is running.
If we use the same approach with Python, each object could have a hash that corresponds to the code only, instead of the data. This is the objects identity even when added to the book keeping data of another subinterpreter.
This requires decoupling of book keeping information from actual object storage. But replaces pointers with lookups which could be inlined to pointer arithmetic.