Simula
Developer Kristen Nygaard | | |
First appeared | 1962 | |
---|---|---|
Stable release | Simula 67, Simula I
| |
Simscript | ||
Influenced | ||
BETA, CLU, Eiffel, Emerald, Pascal, Smalltalk, and many other object-oriented programming languages |
Simula is the name of two
Simula 67 introduced
Simula is considered the first object-oriented programming language. As its name suggests, the first Simula version by 1962 was designed for doing simulations; Simula 67 though was designed to be a general-purpose programming language[3] and provided the framework for many of the features of object-oriented languages today.
Simula has been used in a wide range of applications such as simulating
History
The following account is based on Jan Rune Holmevik's historical essay.[5][6]
Kristen Nygaard was invited to visit the
The
In 1966
Simula was influential in the development of Smalltalk and later object-oriented programming languages. It also helped inspire the actor model of concurrent computation although Simula only supports coroutines and not true concurrency.[7]
In the late sixties and the early seventies, there were four main implementations of Simula:
- UNIVAC 1100 by Norwegian Computing Center (NCC)
- System/370by NCC
- CDC 3000 by University of Oslo's Joint Computer Installation at Kjeller
- TOPS-10 by Swedish National Defence Research Institute (FOA)
These implementations were ported to a wide range of platforms. The TOPS-10 implemented the concept of public, protected, and private member variables and procedures, that later was integrated into Simula Standard in 1986.
Simula Standard 1986 is the latest standard and is ported to a wide range of platforms. There are mainly four implementations:
In November 2001, Dahl and Nygaard were awarded the IEEE John von Neumann Medal by the Institute of Electrical and Electronics Engineers "For the introduction of the concepts underlying object-oriented programming through the design and implementation of SIMULA 67". In April 2002, they received the 2001 A. M. Turing Award by the Association for Computing Machinery (ACM), with the citation: "For ideas fundamental to the emergence of object oriented programming, through their design of the programming languages Simula I and Simula 67." Dahl and Nygaard died in June and August of that year, respectively, [10] before the ACM Turing Award Lecture[11] that was scheduled to be delivered at the November 2002 OOPSLA conference in Seattle.
Simula Research Laboratory is a research institute named after the Simula language, and Nygaard held a part-time position there from the opening in 2001. The new Computer Science building at the University of Oslo is named Ole Johan Dahl's House, in Dahl's honour, and the main auditorium is named Simula.
Sample code
Minimal program
The empty computer file is the minimal program in Simula, measured by the size of the source code. It consists of one thing only; a dummy statement.
However, the minimal program is more conveniently represented as an empty block:
Begin End;
It begins executing and immediately terminates. The language lacks any
Classic Hello world
An example of a
Begin OutText ("Hello, World!"); Outimage; End;
Simula is
Classes, subclasses and virtual procedures
A more realistic example with use of classes,[1]: 1.3.3, 2 subclasses[1]: 2.2.1 and virtual procedures:[1]: 2.2.3
Begin Class Glyph; Virtual: Procedure print Is Procedure print;; Begin End; Glyph Class Char (c); Character c; Begin Procedure print; OutChar(c); End; Glyph Class Line (elements); Ref (Glyph) Array elements; Begin Procedure print; Begin Integer i; For i:= 1 Step 1 Until UpperBound (elements, 1) Do elements (i).print; OutImage; End; End; Ref (Glyph) rg; Ref (Glyph) Array rgs (1 : 4); ! Main program; rgs (1):- New Char ('A'); rgs (2):- New Char ('b'); rgs (3):- New Char ('b'); rgs (4):- New Char ('a'); rg:- New Line (rgs); rg.print; End;
The above example has one
Call by name
Simula supports
Another much simpler example is the summation function which can be implemented as follows:
Real Procedure Sigma (k, m, n, u); Name k, u; Integer k, m, n; Real u; Begin Real s; k:= m; While k <= n Do Begin s:= s + u; k:= k + 1; End; Sigma:= s; End;
The above code uses
Note that the Simula standard allows for certain restrictions on the controlling variable in a for loop. The above code therefore uses a while loop for maximum portability.
The following:
can then be implemented as follows:
Z:= Sigma (i, 1, 100, 1 / (i + a) ** 2);
Simulation
Simula includes a
Sam, Sally, and Andy are shopping for clothes. They must share one fitting room. Each one of them is browsing the store for about 12 minutes and then uses the fitting room exclusively for about three minutes, each following a normal distribution. A simulation of their fitting room experience is as follows:
Simulation Begin Class FittingRoom; Begin Ref (Head) door; Boolean inUse; Procedure request; Begin If inUse Then Begin Wait (door); door.First.Out; End; inUse:= True; End; Procedure leave; Begin inUse:= False; Activate door.First; End; door:- New Head; End; Procedure report (message); Text message; Begin OutFix (Time, 2, 0); OutText (": " & message); OutImage; End; Process Class Person (pname); Text pname; Begin While True Do Begin Hold (Normal (12, 4, u)); report (pname & " is requesting the fitting room"); fittingroom1.request; report (pname & " has entered the fitting room"); Hold (Normal (3, 1, u)); fittingroom1.leave; report (pname & " has left the fitting room"); End; End; Integer u; Ref (FittingRoom) fittingRoom1; fittingRoom1:- New FittingRoom; Activate New Person ("Sam"); Activate New Person ("Sally"); Activate New Person ("Andy"); Hold (100); End;
The main block is prefixed with Simulation
for enabling simulation. The simulation package can be used on any block and simulations can even be nested when simulating someone doing simulations.
The fitting room object uses a queue (door
) for getting access to the fitting room. When someone requests the fitting room and it's in use they must wait in this queue (Wait (door)
). When someone leaves the fitting room the first one (if any) is released from the queue (Activate door.first
) and accordingly removed from the door queue (door.First.Out
).
Person is a subclass of Process
and its activity is described using hold (time for browsing the store and time spent in the fitting room) and calls procedures in the fitting room object for requesting and leaving the fitting room.
The main program creates all the objects and activates all the person objects to put them into the event queue. The main program holds for 100 minutes of simulated time before the program terminates.
Notes
- ^ a b c d e f g h i j k l m n Dahl, Ole-Johan; Myhrhaug, Bjørn; Nygaard, Kristen (1970). Common Base Language (PDF) (Report). Norwegian Computing Center. Archived from the original on 2013-12-25. Retrieved 17 November 2020.
{{cite report}}
: CS1 maint: unfit URL (link) - ^ Nygaard, Kristen (1978). "The Development of the Simula Languages" (PDF).
The development of .. SIMULA I and SIMULA 67... were influenced by the design of SIMSCRIPT ...
- ^ Kristen Nygaard and Ole-Johan Dahl. 1978. The development of the SIMULA languages. History of programming languages. Association for Computing Machinery, New York, NY, USA, 439–480. DOI:https://doi.org/10.1145/800025.1198392
- ^ Wong, William. "Before C, What Did You Use?". Electronic Design. Retrieved 22 May 2017.
- ^
Holmevik, Jan Rune (1994). "Compiling Simula: A historical study of technological genesis" (PDF). IEEE Annals of the History of Computing. 16 (4): 25–37. S2CID 18148999. Retrieved 12 May 2010.
- ^ Holmevik, Jan Rune. "Compiling Simula". Oslo, Norway: Institute for Studies in Research and Higher Education. Archived from the original on 20 April 2009. Retrieved 19 April 2017.
- S2CID 1000741.
- ^ "GNU Cim".
- ^ "Portable Simula Revisited". GitHub. Retrieved 17 June 2019.
- ^ "ACM Ole-Johan Dahl and Kristen Nygaard - Obituary". Acm.org. Archived from the original on 19 July 2011. Retrieved 14 January 2012.
- ^ "ACM Turing Award Lectures". Informatik.uni-trier.de. Retrieved 14 January 2012.
Sources
- Sylvester, Peter. "IBM System 360/370 Compiler and Historical Documentation" (The Simula Standard and other historical documentation).
Further reading
- Pooley, Rob (1987), An Introduction to Programming in Simula, Alfred Waller Ltd, ISBN 0632016116, archived from the originalon 2004-09-19