Tips and tricks?

George Bosworth georgeb at microsoft.com
Wed Mar 10 19:04:43 UTC 2004


Actually, squeak does recompile all the relevant code, it just does it
pretty darn fast, and it deals with the nastiness of already built
objects and methods that are currently running.  How it does so is a
great subject for a long list of vm-implementation tips and tricks.

Questions like this usually come up because most people are familiar
with static or mostly static systems.  Smalltalks, Lisps, and similar
ilk are much more dynamic malleable systems.  The ideal is that at any
point in time a change to any part of the system or the meta-system is
allowed and the system behaves rationally in response to it.  Smalltalks
get pretty close as opposed to pretenders in this area (like Java).  Yes
there are still things one cannot usually get away with, but they are
fewer than most people realize.  I particularly like the test that Dave
Ungar would do on every Smalltalk system he came in contact with: Add a
new instance variable to Object--ideally this should or could be made to
work, but in practice often becomes impractical.  I don't think any
Smalltalk system in that era (late 80s-early 90s) could actually do this
(there is a deep hard problem with changing the shape of objects whose
layout is know to the vm-implementation itself--but these are quite few
in number).  But their failure modes were quite interesting: ranging
from notifiers saying sorry can't do that, to infinite looping, to
recursive does not understand, to process and or machine lockups and
crashes. 

-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of
ducasse
Sent: Wednesday, March 10, 2004 9:27 AM
To: The general-purpose Squeak developers list
Subject: Re: Tips and tricks?

romain
no reread my email. the problem is that reference to instance variables 
are converted to offset in the bytecode. So this is not sure that if 
you allow to add a method that the right offset will be found 
especially because you do not want
to recompile all the code. (may be there is a trick or heuristic 
sorting the
iv but I did not go deep enough into it)

Stef

On 10 mars 04, at 16:38, Romain Robbes wrote:

> Hi stef,
>
> Would the AddInstanceVariableRefactoring solve your
> problem ?
> Just wondering ...





More information about the Squeak-dev mailing list