[Web Feed] When I first introduced Self, I mentioned that Self is a programming language...

Feed Supplier <[email protected]> Mon, 10 May 21 14:40:51 UTC
Newsgroups alt.comp.programming
Organization Usenet.Farm
Message-ID <[email protected]>
.. which employs prototype-based inheritance; it does not depend 



When I 
sin-ack.github.io/posts/a-tour-of-self/: first introduced Self, I mentioned that Self is a programming language which employs _prototype-based inheritance_; it does not depend on a class-instance distinction to facilitate object-oriented programming, but rather, it uses a _prototype object_ from which copies are created. The methods associated with a prototype is stored in a _traits object_ which is just another object storing methods that can be used on a prototype and all its copies through a parent slot.

The trouble begins when we actually try to implement this prototype-based inheritance system as an actual virtual machine, particularly with regards to memory consumption. Say that I have a prototype object 


point


 with a constant parent slot pointing to 


traits point


 and two assignable slots, 


x


 and 


y