The Simula Programming Language

Ted Felix

I started doing some research into Simula (Simula67, etc..) mainly because it seems that every book on object oriented programming that I read mentions Simula as being the first O-O language. So I figure learning it might provide some insight into object oriented design. What follows are some of the most interesting links I've found on the subject.

Simula was created by Ole-Johan Dahl and Kristen Nygaard.

An Introduction to Programming in Simula - Rob Pooley's excellent book on Simula programming. Out of print, but thankfully, Rob has been kind enough to put it online and the wayback machine captured a copy of it. You can also find it on github: https://github.com/fkysly/learn-simula/tree/master/en

Introduction to OOP in Simula - Jaroslav Sklenar's excellent intro to the language. Particularly strong is his coverage of Quasi-Parallel processing (cooperative multi-tasking) in Simula. Very good stuff.

CIM - Simula to C translator for Linux. All the versions are available for download here. Although the server might be picky and you have to come in here and navigate to the "cim" directory. There's a version compiled for Win32 available and lots of libraries too.

Montreal SIMULA Site - Lots of links to lots of information.

Simula Software - A collection of Simula classes and other useful things. I've not had a chance to review any of it, but I hope to.

Books of Interest

Simula BEGIN (Birtwistle, Graham M., et al. 1973) - This is the definitive first book on the language. I was able to win a second printing of the first edition on ebay for $20.57. It arrived 6/26/2006. From the first edition:

Simula Begin

By G M Birtwistle 
O-J Dahl
B Myhrhaug
K Nygaard

Published by Studentlitteratur, Sweden
& Auerbach Publishers Inc. Philadelphia, 

1973

Preface

This book is an introduction to system description in the programming language SIMULA which was designed by three of the authors (O-J. D, B. M, K. N) whilst staff members at the Norwegian Computing Centre (NCC), Oslo.

SIMULA is an extension of the programming language ALGOL 60. SIMULA retains the spirit of ALGOL 60 and includes that language as a subset, except for some minor exceptions noted in Appendix F. The extensions lie in the class and co-routine concepts and the associated reference variables, together with fully defined text handling and input/output facilities. Ideas of C.A.R. Hoare (20) provided the key to combine efficiency, security and ease of use of reference variables.

The book is based upon material developed by G. M. B and K. N for SIMULA courses held at NCC, and papers by O-J. D. The NCC courses have attempted to give a coherent account of the concepts of systems analysis using SIMULA as a vehicle for their description, rather than concentrating upon a bit-by-bit explanation of the language atoms. By this means, it is hoped that the students have retained a clearer picture of what programming is all about — namely, the arts of decomposition and classification — and the SIMULA tools provided.

The first chapter of the book presents the most important features of SIMULA in an informal style. This chapter is meant to give a feel for the language elements and programming style in SIMULA, so that they can be accepted as meaningful with confidence in later chapters where precise definitions are given.

The next five chapters of the book gradually build up complete pictures of the basic units of SIMULA — blocks, procedures, classes and objects — and explain text handling and input/output.

Chapter seven is a set of SIMULA applications, covering extensions to array handling, information structures and lists. The chapter shows how the unique prefixing ability of SIMULA can be used to write and use application packages.

The final two chapters are given over to quasi-parallel systems (co-routines) with simulation as the main application field. The system-defined simulation features of SIMULA are carefully explained, and examples of their extension given. However, the reader is warned that this is not a book on SIMULA as a simulation language.

Contents

PREFACE 

1.    SYSTEM DESCRIPTION

1.1   Systems and models

1.2   Basic concepts of SIMULA
1.2.1 Top-down and bottom-up-approaches 
1.2.2 Example: a post office system 
1.2.3 Objects 
      Action Pattern 
      Variables 
      IF statements 
      Labels 
      Classes 
      Subsystems and Objects 
      Reference Variables 
      Repetitive Statements 
      Compound Statements 
      Object Generators 
      CLASS-declarations 
      The COUNTER Subsystem Build-Up 
      REAL-variables 
      Synchronization of actions 
      Object Termination and Exit 
1.2.4 The SYSTEM-object 
1.2.5 The First SIMULA Version of the Post Office 
      Conditions and BOOLEAN-variables 
      Arithmetic Statements 
      Reference relations 
1.2.6 Open and Closed descriptions 
1.2.7 The Second SIMULA Version of the Post Office

1.3   Some aspects of computers
1.3.1 An idealised computer system 
      Elementary actions 
1.3.2 Compile time and run time 
      Compile time 
      Run time 
1.3.3 An elementary view of Input and Output
      Input from cards 
      Output to a line printer 
1.3.4 Data representation in the memory 
      BOOLEAN-variables
      INTEGER-variables 
      REAL-variables 
      Reference-variables 
      Objects
      Implementation defined

2.    BLOCKS

2.1   A block
      Program 2.1. The average and highest mark of a list of numbers
      Model of program execution 
      Elementary Binding Rule 
      Program termination
      Discussion of Program 2.1 
      — assignment-statement 
      — multiple-assignment-statement 
      — WHILE-statement 
      — IF-statement 
      — compound-statement 
      Exercises 2.1 

2.2   Inner blocks
      Program 2.2. Calculation of frequencies
      Model of program execution 
      Binding Rule
      Program termination 
      Discussion of program 2.2 
      — Comment 
      — FOR-statement
      — Arrays 
      Exercises 2.2

2.3   ...and more on blocks
2.3.1 The run time stack 
2.3.2 Blocks: a summary 
      Exercises 2.3 

3.    PROCEDURES

3.1   Procedure statements
      Program 3.1. Rainfall plot 
      Discussion of program 3.1 
      Exercises 3.1

3.2   ...and function procedures
      Program 3.2. Penny flipping problem
      Model of program execution 
      Epilogue
      Discussion of programs 3.1 and 3.2
      — PROCEDURE-declaration 
      — System-defined procedures 
      Exercises 3.2 

3.3   Procedures as composition tools
      Program composition

4.    CLASSES

4.1   Basic concepts
      Program 4.1. Find the centre and radius of the circle passing through
                   three distinct points 
      The class skeletons 
      — Class POINT 
      — Class LINE 
      — Class CIRCLE 
      Reference-comparators 
      Object-reference-variable declarations         
      Qualification and reference-assignment          
      Remote accessing 
      The CLASS-declarations 
      — Class POINT revisited 
      — Class LINE revisited 
      — Class CIRCLE revisited 
      Exercises 4.1

4.2   System description in levels
      Reference security 
      Class LIFO (last-in, first-out) 
      Prefixed blocks 
      Discussion on 4.2. 
      — CLASS-declarations 
      — Class hierarchies 
      — INNER 
      — Remote accessing 
      — Use of QUA 
      — THIS CLASS-identifier 
      — INSPECT-statement 
      — Qualification and object-reference-assignment revisited 
      Exercises 4.2 

4.3   The VIRTUAL concept
      Program 4.3. Write a program to assemble and plot the symmetric
                   figure shown in fig. 4.3.1 
      Discussion of program 4.3 
      — Dummy-statement 
      — Virtual quantities 
        1) attribute redefinition 
        2) inner accessibility 

4.4   Debugging

5.    RECURSION
      Program 5. The Towers of Hanoi I
      Execution of the program for 2 discs
      Recursive functions 
      Exercises 5 

6.    CHARACTER HANDLING, TEXT HANDLING AND INPUT/OUTPUT

6.1.  Character handling
      Program 6.1. Letter incidence count
      Exercises 6.1 

6.2.  Text handling
6.2.1 Basic concepts 
      Text-reference-assignment 
      Character access 
      TEXT-value-assignment
      TEXT-comparisons 
6.2.2 Text editing and de-editing
      — De-editing procedures
      — Editing procedures 
      Texts as parameters 
      Exercises 6.2 

6.3   Basic input/output features
      Class file 
      Class INFILE 
      Class OUTFILE 
      Class PRINTFILE I
      Class basico 
      Program 6.3.1. Pretty print 
      Program 6.3.2. Data processing
      Exercises 6.3. 

7.    LEVELS OF SYSTEM DESIGN

7.1   Array handling-class BOARD
7.1.1 Class BOARD
      Program 7.1.2. The game of LIFE
      IF-expressions 
      Program 7.1.3. Route finding through a rectangular maze
      Exercises 7.1 

7.2.  A family tree structure
      Class FAMILY 
      Class PERSON 
      Exercises 7.2 

7.3.  Circular two way lists-class SIMSET
      Class LINKAGE 
      Class LINK 
      Class HEAD 
      Program 7.3. Write a program to generate a deck of cards and deal 
                   them to four players 
      Exercises 7.3 

7.4.  Binary search trees
7.4.1 Class TREE 
7.4.2 Use of Class TREE 
      Program 7.4.1. Number count 
      Program 7.4.2. Word count 
      Exercises 7.4 

7.5   Symbolic differentiation-class EXPRESSION
      Program 7.5.1 
      The differentiation procedures 
      Program 7.5.2 
      Displaying the results 
      Program 7.5.3 
      Exercises 7.5 

8.    A PROGRAM AS COMPONENTS IN QUASI-PARALLEL

8.1   Setting the wheels in motion
      Program 8.1. Buffering 
      Program 8.2. MINILUDO 
      Exercises 8

9.    SIMULATION

9.1   Simulation and class SIMULATION
      Car wash simulation 
      The class SIMULATION 
      — Class SIMULATION
      — Class PROCESS 
      — MAIN 
      — the active component and simulated time
      — scheduling 

9.2.  Car wash simulation
      Program 9.2. Class WASHINGCARS
      Discussion of Program 9.2 
      Exercises 9.2 

9.3.  A platform for counter simulations
      — Class STATION 
      — Class CLERK 
      — Class CUSTOMER 
      — Class COUNTER 
      Exercises 9.3 
9.3.1 Airport departure simulation 
      Class AIRPORTDESCRIPTION 
      Program 9.3.1 Airport departure 
      Discussion of program 9.3.1 
9.3.2 Booking office simulation 
      Program 9.3.2 class INFORMATIONSYSTEM and its use
      Exercises 9.3 (continued) 

REFERENCES AND FURTHER READING

SOLUTIONS TO STARRED EXERCISES

APPENDICES

A.  Syntax of SIMULA
    1.  Program 
    2.  Syntatic variables and their definition
    3.  SIMULA atoms 
    4.  Comment conventions 
    5.  Blocks and statements 
    6.  Expressions 
    7.  Declarations 
    8.  Types and constants 
    9.  Omissions 

B.  The system classes SIMSET and SIMULATION

C.  System defined functions and procedures

D.  Random drawing procedures

E.  Parameter transmission modes

F.  The differences between ALGOL 60 and SIMULA

INDEX

Object-Oriented Programming with SIMULA (Kirkerud, Bjoern 1989) International Computer Science Series. Addison-Wesley Publishing Co. (1989). ISBN 0-201-17574-6.

Copyright ©2005, Ted Felix. Disclaimer