[self-interest] Saving objects with Hackney [1 Attachment]
Josh Flowers
joshflowers at mac.com
Sun Jan 2 21:43:06 UTC 2011
This sounds great Russell. The transporter was a point of
unsureness when I worked on the IRC client, so I'll be looking at
your code with interest.
Your e-mail brings up a question I've been pondering (when I have
time to ponder Self) - could we load multiple snapshots into a single
running VM? Last time I played with Squeak it had the concept of
Projects (least that's what I think they were called) which were
almost like separate worlds within a single VM. Is it technically
possible to do something similar in Self? Is there anything about the
VM that precludes having multiple, separate lobbies? Or traits?
true's and false's?
> All the talk about object saving etc inspired me to throw together a rough sketch of a framework for object saving as a exercise in building stuff in Self. The code builds upon the transporter's facilities but ignores modules.
>
> All it does is take a object root, map out the bounds of the object cluster using a fitness test, then write out the set of objects on the file in a pleasing indented manner. It more or less handles internal loops; but a nice mechanism for that depends on moving the parser from the VM into Self. It has a hardcoded limit of 1000 objects to iterate over, just to make development easier by preventing accidentally iterating over the entire image.
>
> The current fitness test is simply whether (a) the sub-object has a creatorPath and (b) whether it is a worldMorph. Playing with this is a good illustration of Dave's point that the tricky question is where to stop!
>
> This is a rough outline of a framework for testing stuff (in particular there aren't any tests and the code is ugly :) - it probably isn't particularly useful.
>
> Things I missed while writing this: a streams library, a unit testing framework, a modifiable Self parser
>
> If you take a clean snapshot and put the attached hackney.self file in the same directory, you can load it by:
>
> bootstrap read: 'hackney' From: ''
>
> and then save objects as:
>
> transporter hackney save: myObject As: fileName
>
> and load by getting the results of:
>
> transporter hackney read: fileName
>
> Have fun, Russell
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
More information about the Self-interest
mailing list