Don't bother to try this out until you are ready to read chapter
4 of Hopkins and Horan.
VisualWorks runs on Unix machines, Windows, OS/2, and Macintoshes. Some
things are different on each machine.
Nevertheless, the applications you write can run on any platform, and
the instructions here can be mostly the same.
First, you have to find the main VisualWorks directory. On the instructional
lab Unix machines, this will be
/usr/dcs/software/licensed/visual-3.0. On the CRL machines, it will
be /usr/dcs/packages/smalltalk/visual. If it is on a PC
(I'm counting a Mac as a PC here; just translate "directory" as "folder")
then it will be whereever you put it.
The directory will have subdirectories with names like "image", "bin",
and "tutorial". The "image" directory contains
visual.im, which is the VisualWorks "image", visual.sou, which is the
sources file, and maybe visual.cha, which is the
changes to the original sources. The image is the complete set of objects
that represents your code and the development
environment. It is big. When you are running Smalltalk, the image is
always in memory. You will program by typing code into
a running image. You can also "file in" code into the image. Think
of the image as the Smalltalk application, though it is
really more than that.
The image only stores compiled programs, all the source code is kept
in other files. visual.sou contains the common code,
while the *.cha file contains the code that you write or file in. visual.sou
is huge, while your *.cha file is relatively small. Be
happy!
You will execute a VisualWorks image on Unix by running the "virtual
machine" and giving it the image name as an argument.
When I use VisualWorks on Unix, I usually make a symbolic link to the
main directory, and call it visual. Then I can run a
clean image by typing "visual/bin/visualworks visual/image/visual.im".
Of course, you could also put a link to visualworks
in your bin directory, or include the VisualWorks bin directory in
your search path. The important thing to realise is the
visualworks is a Unix program, while visual.im is a portable image.
The image can be run on any platform that has a
VisualWorks "virtual machine", while visualworks is the virtual machine
itself.
Life is easier on a Mac (and I assume, on other PCs) because I can just
double-click on visual.im and the virtual machine
starts itself.
The instructional lab machines have the SPARC version loaded. We also
have VisualWorks 3.0 for Windows and HP. We
have the previous version (2.5) for the Mac. We have a Linux version
of 3.0, too.
Once you start to use VisualWorks, you will want to have your own copy
of the image. If you save an image you are working
on, it will start up just like it left off, with the same objects,
the same code, the same windows, the same state of debuggers,
etc. You can run your image by using its name instead of visual.im.
When you save an image as "mine" it will be really
named "mine.im" and your changes will be called "mine.cha". The changes
file will probably be small, but the image file
will be big. You'll probably need to get your quota increased before
you can save a file!
One of the nice things about VisualWorks 3.0 is that the documentation
is on the world wide web. You can find many of these
files in the "doc" subdirectory, too, and it is usually faster to look
at local copies.