Question : I would like to understand the basics of how to write and execute a small talk program on Linux OS.
Can you explain it with a simple example? Answer : In this article, let us review very quickly how to write a basic Hello World SmallTalk program and execute *.st program on Linux or Unix OS.
1. Write a Hello World SmallTalk Program
Create the helloworld.st program using the Vim editor as shown below.
$v i mh e l l o w o r l d . s t " H e l l ow o r l dP r o g r a m " ' H e l l oW o r l d ! 'p r i n t N l!
2. Make sure gst (GNU Smalltalk) is installed on your system
Make sure gst is installed on your system as shown below.
$w h e r e i sg s t g s t :/ u s r / b i n / g s t/ u s r / i n c l u d e / g s t . h/ u s r / s h a r e / m a n / m a n 1 / g s t . 1 . g z $w h i c hg s t / u s r / b i n / g s t
Installing GNU Smalltalk virtual machine.
If you dont have smalltalk virtual machine, install it as shown below.
$s u d oa p t g e ti n s t a l lg n u s m a l l t a l k
3. Execute the small talk program.
$g s th e l l o w o r l d . s t H e l l oW o r l d !
4. Smalltalk interactive mode
You can also execute smalltalk commands interactively in the smalltalk shell as shown below.
$g s tq G N US m a l l t a l kr e a d y s t >' H e l l oW o r l d ! 'p r i n t N l! ' H e l l oW o r l d ! ' s t >