GNU Smalltalk

Implementation of programming language Smalltalk

A free implementation of Smalltalk-80, part of GNU Project. It runs on most POSIX-compatible platforms, including Linux and Windows.

Examples:

Hello, World!:

Example for versions gst 3.1
'Hello, World!' printNl.

Fibonacci numbers:

Example for versions gst 3.1

This example uses iterative definition of Fibonacci numbers,.

a1 := 0.
a2 := 1.
0 to: 15 do: [ :i |
  a2 display.
  t := a1 + a2.
  a1 := a2.
  a2 := t.
  ', ' display
]
'...' displayNl.

Factorial:

Example for versions gst 3.1

Smalltalk provides built-in factorial method of class Number, so the example is really simple.

0 to: 16 do: [ :i |
  i display.
  '! = ' display.
  i factorial displayNl
].