Loading a new image file into an already running session?
John M McIntosh
johnmci at smalltalkconsulting.com
Sun Nov 17 03:31:44 UTC 2002
> But what if I load up a new image? Is there a default change set that
> will get automatically loaded?
>
> --
> Lloyd Zusman
> ljz at asfast.com
Mmm lets step back to some basics.
a) You've a VM. That's a C program that came from a subset of smalltalk
called SLANG that is the Interpreter class (and others) in the image.
The VM excluding some platform unique primitives and the OS support
structure is written in Smalltalk, then translated to C. You'll also
notice classes ending in Plugin, those too are translated to C, and
either are fully self contained, or call out to platform specific C
implementation code.
You can run an image file within the image using the Smalltalk
Interpreter by doing
interp _ InterpreterSimulator new openOn: 'mini.image'. where
mini.image is the image you want to open.
Well you should be able to, we have a bad habit of breaking it. I think
it's broken again.
b) You've the image file (I've 98 of them on my hard disk right now,
even after cleaning things up a bit. Wouldn't want to count the VM I've
got about). That contains the bits born upwards of long ago. Some
Smalltalks like Smallscript acually use a declarative form of Smalltalk
to "create" all the bits at startup time, versus using old bits. Cool,
but the important piece is that on a save the bits are archived (a
snapshot) to disk and you quit, on restarting the bits get read in and
you continue where you came from, with shutdown and startup code
(hopefully running correctly).
c) The change file (optional I might add since you can have an image
without a change file) is the archived log of *all* the changes you
have made to the original source code, that is there for recovery,
review, undo, audit, etc. You can consolidate changes into change sets
which then you can apply to other images. In really large smalltalk
systems you might have a 'librarian' who's role is to mange those
change sets (using Envy or Store or some other versioning system).
d) The SqueakV3.source is a file that contains all the source code in
the image that was consolidated from a previous source file and change
file in the past (actually when 3.0 was born). That is static, I've
only one on my machine and 98 aliases that point to it.
e) Not having access to the source or the change file isn't a problem
to run the image, it's a problem if you want to edit because you lose
comments, variable names etc. However you still can edit because the VM
falls back to decompiling the bytecodes and presenting the source code
that would create the bytecodes. Ah but if you mismatch the changes
file to an image file you run into more serious problems because
indexing into the changes file to grab the text to display gets really
confused.
f) On starting the Squeak VM, it looks for a image/change file set to
use, say squeak.image & squeak.changes. Otherwise you could drag and
drop or give command line to indicate a different change set. say
Zusman98.image, by agreement the change set needs to be called
Zusman98.changes. Thus you get 98 images/change sets on your hard disk.
g) Most VMs only will allow you to start one image, unlike some
programs that would let you open multiple documents. I'm not sure
offering this would be useful? Since you can just start another VM
application and point to a different image/change set. MMm I think the
mac Cocoa version allows this.
h) various plugins exist, FFI, mpeg, matrix? (mystery plugin as far as
I know). Those live either in a plugin folder, or loose in the
directory of the VM. They are shared libraries/bundles/DLLs and help
reduce the memory footprint by excluding their overhead for small
platforms that wouldn't support MPEG for example.
PS I'm sure I've missed something.
Only memory will prevent you from running say 98 image/change sets and
98 VMs at the same time.
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Squeak-dev
mailing list
|