Hi Stef

On Jan 13, 2015, at 4:23 AM, stepharo <[email protected]> wrote:

> 
>> 
>> I hope we'll also be able to follow a 5th direction, of allowing one to 
>> specify a slice or a trait or a package that just adds an inst var to a 
>> class instead of having to provide the whole class definition just to add an 
>> inst var.
> 
> We would love.
> With Epicea we have Changes representing not only class and instance 
> addition/removal...
> Now the question is also how do we initialize such new added instance 
> variable.

That's easy if the slot definition has an initialiser.

> Now we have probably to recompile the full class hierarchy.

I don't see a way if avoiding this unless we move to a self/newspeak model of 
inst var accessor.  But it can be made much faster than recompiling from 
source.  The idea is simply to disassemble every method from bytecode to an 
assembler level representation (such as Marcus' byte surgeon or my method 
massage), adjust offsets and regenerate.

This is what VisualWorks does and it is /much/ faster than recompiling from 
source.


> We are brainstorming on a modular way to initialize objects
> What are the paths to achieve that in a clever way.

Yes the monolithic initialize method is an issue if one wants to be able to add 
inst vars individually.  Lazy initialize toon in accessors is one way.  That 
works well for eg inst vars used to implement caches (although now flushing 
becomes an issue).  There's no such thing as a free lunch :-)

Reply via email to