We will first introduce VisualWorks and then you people will get to try writing small programs -- "Hello, world" and a factorial program.
% visualworks /usr/local/visual/image/visual.im
Two small windows will pop up: the main window and a workspace.
The main window and the workspace window are shown below:

2. Writing some very simple expressions.
We will not be looking at all of the menu and button options in the main
window, but right now you can use the workspace and practice writing some
simple Smalltalk expressions.
Try typing:
3 + 4. To execute the expression, highlight it and then
middle-mouse click. Select "print it" from the pop-up menu. Woo!
Transcript show: 'Hello!'. Select "do it" from the menu
this time to execute.
Transcript show: 'Smalltalk is fun!'.
To open a System Browser, select Browse->All Classes from the
main window or use the shortcut button
. Notice that a System Browser is divided into
four columns across the top half of the window, and the bottom half
contains a text area.
The first column is the Categories column; the classes are first organized by categories, to make it easier to manage them (and there are hundreds of them). These categories are completely arbitrary, so you can reorganize the classes any way you want. After you select a category, a list of the classes in that category will appear in the the second column, the Classes column. When you select a class, the members of the Protocols column appear; these are just groups of methods. Select a protocol and finally, the methods of the class will show in the last column, Methods.
Have fun exploring VisualWorks on your own, but the help system doesn't seem
to work. Notice also, that when you quit VM it will prompt you
to "save" something -- type in /home/your_name/me.im. Now,
when you start VW again you just have to type visualworks
me.im and all of your work from the last session has been saved!
In this section, you will learn how to make a new class using the System Browser.
Test.
Object subclass: #HelloWorld
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Test'
HelloWorld.
printing fun.
print
^'Hello, World'
HelloWorld.
Hi := HelloWorld new. /* middle-click mouse and select "inspect" */
Hi print. /* middle-click and select "print it" */
After you inspect the first part, VisualWorks will prompt
you to declare Hi as a global or temporary variable. Choose
global, so that when you run the second statement, you will not have to
highlight the first statement.
Magnitude-Numbers in the first column. You should
then see the subclasses ArithmeticValue, Double, FixedPoint, etc. in the
second column. Now, click once on Integer. Then, in the
third column click factorization and division. You will see
several methods there already: an iterative factorial, gcd, icm, etc.
You are now ready to begin writing your first factorial program in Smalltalk. Go to the coding area in the lower half of the window and write:
recFact
self < 0
ifTrue : [^0]
ifFalse: [
self = 0
ifTrue : [^1]
ifFalse: [^self * (self -1) recFact]
]