3 ms·
In JS for example, if you change the prototype of an object you have effectively changed it's data layout but of course everything is behind a pointer / an indi
by robertkrahn01 4y ago
In JS for example, if you change the prototype of an object you have effectively changed it's data layout but of course everything is behind a pointer / an indirection.
When changing instance or class variables in Smalltalk, the system actually changing the object layout and goes and recompiles code using it. If you are interested in the details: Chapter 5 of [1] explains it a bit.
[1] Hirschfeld et al. Assisting System Evolution: A Smalltalk Retrospective. http://soft.vub.ac.be/Publications/2002/vub-prog-tr-02-25.pdf http://soft.vub.ac.be/Publications/2002/vub-prog-tr-02-25.pd...
- steveklabnik 4y agoThanks!