3 ms·
There's a nice object model called 'id' described at https://piumarta.com/software/cola https://piumarta.com/software/cola which is really simple and general-pu
by chriswarbo 6y ago
There's a nice object model called 'id' described at https://piumarta.com/software/cola https://piumarta.com/software/cola which is really simple and general-purpose.
In this system, an object is simply a pointer to some memory (where instance data can be stored), preceded by a pointer to a 'vtable'; i.e. `myObject` is a pointer to some memory, and `myObject[-1]` is a pointer to a vtable.
Vtables are themselves objects, implemented in the same way as above. There is a "vtable API" defining methods that a vtable should support, and a default 'vtable vtable' is defined during a bootstrap step (which is its own vtable).
The resulting object system has objects which are completely opaque: they're just arbitrary chunks of memory, which are only useful to the methods defined by their associated vtable. Since those vtables are also opaque objects, we can provide our own objects which implement the idea of 'method call' in whichever way we like.
- scroot 6y agoPiumarta's COLAs work, and Maru, does not get enough attention. I only understand maybe understand 30% of the COLAs paper but one can intuit that there is real power there.