The Slate image

Todd Fleming todd at flemingcnc.com
Sun Jan 9 21:24:15 PST 2005


Shaping wrote:

>> Not quite. little.image isn't a saved image, it's a generated one. In 
>> fact, it's not even a full image. It only contains a handful of 
>> objects and one large block. The block generates all the objects and 
>> blocks that make up the system; that's why it takes time to start.
>
>
> Interesting.  So, the full set of objects is never stored with the 
> image, but is always reconstituted by some set of source statements?  
> If so, how does this source get created?  Is it just a record of every 
> statement I typed and evaluated before saving the image, or is it a 
> nicely factored and cleaned up version of this, or something else?
>
>
> Shaping

The full set of objects *is* saved when you run saveImageNamed:. That's 
why saved images are faster to load than little.image; they don't need 
to regenerate the objects. little.image is generated. work.image (or 
whatever you name it) is a snapshot of a running system. Here's the cool 
part: little.image and vm.* are generated by a slate program.Yes, it's a 
chicken-and-egg problem. Each new version of Slate is generated by the 
previous version. Anytime someone makes changes to the Slate library 
sources or to the .slate VM sources, they have to do the following (or a 
subset, depending on the change):

load: 'src/mobius/init.slate'.   "This compiles the master generator"
VM generate &named: 'vm'.
VM buildImage &named: 'little.image'.

The master generator (written in Slate) reads Slate source code and 
produces vm.h, vm.c, and little.image from it. little.image has that 
large block that generates the library objects and blocks. Basically, 
src/mobius/init.slate is a generator that writes a generator that 
produces a running system.

Todd




More information about the Slate mailing list