Frequently Asked Questions - Introduction

What is "The Smalltalk for those who can type" supposed to mean?

It is a pun on the usage of a text editor (and thus using the keyboard more, and the mouse less) to write programs for GNU Smalltalk, which sets it different from other Smalltalk.

What is Smalltalk?

Smalltalk is a programming language, though very often the term is used to indicate a programming environment for the language. Note that the t in Smalltalk is lowercase.

GNU Smalltalk implements the recognized ANSI standard for the Smalltalk language, which is ultimately a descendant of the Smalltalk-80 language developed at Xerox PARC. Much of the class library is identical to that of Smalltalk-80: they both have objects, classes, single inheritance, blocks, garbage collections, collections, streams, and many other bits. In addition to this, GNU Smalltalk provides other classes including networking and GUI programming.

How does Smalltalk look like?

Let's define a class called Person, holding a name and an age. (Note: this code only works in Smalltalk 2.95a and later. The syntax for previous versions is more verbose and less clear).

Object subclass: Person [
    | name age |
    Person class >> name: aString age: anInteger [
        ^self new name: aString; age: anInteger; yourself

    name [ ^name ]
    name: aString [ name := aString ]
    age [ ^age ]
    age: anInteger [ age := anInteger ]

    printOn: aStream [
        aStream << ('%1 (%2)' % {name. age})

Now, let's try it out:

(Person name: 'Paolo' age: 27)    "returns Paolo (27)"

Let's add two of them into a collection:

coll := {
   Person name: 'Paolo' age: 27.
   Person name: 'Luisa' age: 28.

... so that we can sort them:

coll asSortedCollection: [ :x :y | x name <= y name ]
coll asSortedCollection: [ :x :y | x age <= y age ]

We can also load people from a file. This uses a powerful tool for iteration known as the stream:

file := (File name: 'foo') readStream.

The following lines modify the stream in place. That is, each line returns another stream:

lines := file lines.
lines := lines select: [ :line | line ~ '^[A-Za-z]+ [0-9]+$' ].
fields := lines collect: [ :line | line subStrings ].
people := fields collect: [ :data |
            Person name: data first age: data second asInteger ].

These lines operate on different kinds of stream: one that returns lines, one that filters away invalid data, one that processes what remains, and one that finally creates Person objects. However, all of them operate in the same way.

Also note that so far the code has not read a single line from the file! This allows big amounts of data to be processed efficiently. Continuing the example, the following iteration command prints the people in the file, keeping in memory only one line at a time:

people do: [ :each | each printNl ]

That's it!

How do I get GNU Smalltalk?

See the download section of this site.

If you are interested in development versions, you might also use the git repository (or the CVS mirror) that host the most recent code for GNU Smalltalk.

How stable is GNU Smalltalk? How scalable? How fast?

It is quite stable. There are bugs for sure in the virtual machine, but unless you're unlucky you shouldn't be affected. This is especially true for the stable branch, where only changes to improve stability are made; development releases are by their very nature less stable.

It is quite scalable, even though the garbage collector performs worse once you have more than 150-200 MB of live data. Very long strings also do not perform as well as they could. In general, object-orientation makes it easier to pick good data structures (such as streams).

It is quite fast. While GNU Smalltalk has an experimental just-in-time compiler, even the bytecode interpreter should be faster than most other scripting languages. However, GNU Smalltalk's base classes are written entirely in Smalltalk (unlike Python or Lua, for example). While this gives more flexibility to the programmer, programs that heavily use dictionaries may run slower than the equivalent programs in other languages.

Is there a GNU Smalltalk tutorial?

Yes, there is a tutorial that is part of the GNU Smalltalk manual. See here for an online version.

You may also be interested in Canol Gokel's book "Computer Programming using GNU Smalltalk". You can get the e-book version for free, or buy a printed version.

How do I submit bug reports and patches for GNU Smalltalk?

There is a mailing list. See also the community section of this web site.

Does copyright restrict the use of GNU Smalltalk?

It does, but in general you don't need to worry much about the licensing of your Smalltalk programs.

The class library is licensed under the GNU LGPL. Thus, it permits using the library together with non-free programs.

The virtual machine and the bindings to external libraries are licensed under the GNU GPL, with a special exception that allows Smalltalk programs to be linked with the functions exported by the virtual machine and said bindings.

Where's the GUI?

GNU Smalltalk does not by default start a full-blown integrated development environment. However, one is available and can be started with this command:


The latest git versions include a new IDE, called VisualGST, that can be started with this command instead:


My question is not listed here!

Write it in a comment to this question.

User login