Simula

Simula

Infobox programming language
name = Simula

paradigm = object-oriented
year = 1967
designer = Ole-Johan Dahl, Kristen Nygaard
developer =
latest_release_version =
latest_release_date =
latest_test_version =
latest_test_date =
typing =
implementations = [http://www.gnu.org/software/cim/cim.html GNU Cim]
dialects =
influenced_by = ALGOL 60
influenced = Object-oriented programming languages
operating_system =
license =
website =

Simula is a name for two programming languages, Simula I and Simula 67, developed in the 1960s at the Norwegian Computing Center in Oslo, by Ole-Johan Dahl and Kristen Nygaard. Syntactically, it is a fairly faithful superset of Algol 60.

Simula 67 introduced objects, classes, subclasses, virtual methods, coroutines, discrete event simulation, and features garbage collection.

Simula is considered the first object-oriented programming language. As its name implies, Simula was designed for doing simulations, and the needs of that domain 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 VLSI designs, processes, protocols, algorithms, and other applications such as typesetting, computer graphics, and education. Since Simula-type objects are reimplemented in C++, Java and C# the influence of Simula is often understated. The creator of C++, Bjarne Stroustrup, has acknowledged that Simula 67 was the greatest influence on him to develop C++, to bring the kind of productivity enhancements offered by Simula to the raw computational speed offered by lower level languages like BCPL.

History

Kristen Nygaard started writing computer simulation programs in 1957. Nygaard saw a need for a better way of describing the heterogeneity and the operation of a system. To go further with his ideas on a formal computer language for describing a system, Nygaard realized that he needed someone with more programming skills than he had. Ole-Johan Dahl joined him on his work January 1962. The decision of linking the language up to Algol 60 was made shortly after. By May 1962 the main concepts for a simulation language were set. "SIMULA I" was born, a special purpose programming language for simulating discrete event systems.

Kristen Nygaard was invited to Univac late May 1962 in connection with the marketing of their new UNIVAC 1107 computer. At that visit Nygaard presented the ideas of Simula to Robert Bemer, the director of systems programming at Univac. Bemer was a sworn ALGOL fan and found the Simula project compelling. Bemer was also chairing a session at the second international conference on information processing hosted by IFIP. He invited Nygaard, who presented the paper "SIMULA -- An Extension of ALGOL to the Description of Discrete-Event Networks".

Norwegian Computing Center got a UNIVAC 1107 August 1963 at a considerable discount, on which Dahl implemented the SIMULA I under contract with Univac. The implementation was based on the UNIVAC Algol 60 compiler. SIMULA I was fully operational on UNIVAC 1107 January 1965. In the following couple of years Dahl and Nygaard spent a lot of time teaching Simula. Simula spread to several countries around the world and SIMULA I was later implemented on Burroughs B5500 computers and the Russian URAL-16 computer.

In 1966 C. A. R. Hoare introduced the concept of record class construct, which Dahl and Nygaard extended with the concept of prefixing and other features to meet their requirements for a generalized process concept. Dahl and Nygaard presented their paper on Class and Subclass Declarations at the IFIP Working Conference on simulation languages in Oslo, May 1967. This paper became the first formal definition of Simula 67. In June 1967 a conference was held to standardize the language and initiate a number of implementations. Dahl proposed to unify the Type and the Class concept. This led to serious discussions, and the proposal was rejected by the board. SIMULA 67 was formally standardized on the first meeting of the SIMULA Standards Group (SSG) in February 1968.

Simula was influential in the development of Smalltalk and later object-oriented programming languagues. It also helped inspire the Actor model of concurrent computation although Simula only supports co-routines and not true concurrency.

In the late sixties and the early seventies there were four main implementations of Simula:

* UNIVAC 1100 by NCC
* System/360 and System/370 by Swedish Research Institute for National Defence (FOA)
* CDC 3000 by University of Oslo's Joint Computer Installation at Kjeller
* TOPS-10 by ENEA AB

These implementations were ported to a wide range of platforms. The TOPS-10 implemented the concept of public, protected, and private member variables and methods, that later was integrated into Simula 87. Simula 87 is the latest standard and is ported to a wide range of platforms. There are mainly three implementations:

* Simula AS
* Lund Simula
* [http://www.gnu.org/software/cim/cim.html GNU Cim] - [ftp://ftp.gnu.org/gnu/cim Download available from the GNU ftp site]

In November 2001 Dahl and Nygaard were awarded the IEEE John von Neumann Medal by the Institute of Electrical and Electronic Engineers "For the introduction of the concepts underlying object-oriented programming through the design and implementation of SIMULA 67". In February 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." Unfortunately neither Dahl, nor Nygaard could make it to the [http://www.informatik.uni-trier.de/~ley/db/journals/cacm/turing.html ACM Turing Award Lecture] , scheduled to be delivered at the OOPSLA 2002 conference in Seattle, as they both [http://www.acm.org/announcements/turing_obit.html passed away within two months of each other] in June and August, respectively.

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.

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 does not have any return value from the program itself.

Classic Hello world

Note that Simula is case-insensitive. An example of a Hello world program in Simula:

Begin OutText ("Hello World!"); Outimage; End;

Classes, subclasses and virtual methods

A more realistic example with use of classes, subclasses and virtual methods:

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 super class (Glyph) with two subclasses (Char and Line).There is one virtual method with two implementations.The execution starts by executing the main program.Simula does not have the concept of abstract classes since classes with pure virtual methods can be instantiated. This means that in the above example all classes can be instantiated. Calling a pure virtual method will however produce a runtime error.

Call by name

Simula supports call by name so the Jensen's Device can easily be implemented.However, the default transmission mode for simple parameter is call by name in ALGOL but call by value in Simula.The source code for the Jensen's Device must therefore specify call by name for the parameters when compiled by a Simula compiler.

Another much simpler example is the summation function sum which can be implemented as follows:

Real Procedure Sigma (l, m, n, u); Name l, u; Integer l, m, n; Real u; Begin Real s; l:= m; While l <= n Do Begin s:= s + u; l:= l + 1; End; Sigma:= s; End;

The above code uses call by name for the controlling variable (l) and the expression (u).This allows the controlling variable to be used in the expression.Note that the Simula standard allows for certain restrictions on the controlling variablein a for loop. The above code therefore uses a while loop for maximum portability.

The following:

Z = sum_{i=1}^{100}{1 over (i + a)^2}

can then be implemented as follows:

Z:= Sigma (i, 1, 100, 1 / (i + a) ** 2);

Simulation

Simula includes a simulation package for doing discrete event simulations. This simulation package is based on Simulas object oriented features and its coroutine concept.

Sam, Sally, and Andy are shopping for clothes. They have to 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 methods 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.

See also

* Object-oriented programming
* BETA programming language (a modern successor to Simula)
* Simulation language
* ALGOL 60

Source

* [http://heim.ifi.uio.no/~cim/sim_history.html Compiling Simula] Early history of the development of Simula by Jan Rune Holmevik
* [http://www.edelweb.fr/Simula/ IBM System 360/370 Compiler and Historical Documentation] The Simula Standard and other historical documentation by Peter Sylvester

External links

* [http://staff.um.edu.mt/jskl1/talk.html Introduction to OOP in Simula] &ndash; By J.Sklenar, based on the 1997 seminar "30 Years of Object Oriented Programming (OOP)" at the University of Malta
* [http://heim.ifi.uio.no/~kristen/FORSKNINGSDOK_MAPPE/F_OO_start.html How Object-Oriented Programming Started] &ndash; By Dahl and Nygaard, abbrev. version of an encyclopedia article; on Nygaards home page
* [http://www.iro.umontreal.ca/~simula/ Simula at the Université de Montréal] Includes tutorials, documentation, and links in English and in French
* [http://www.macs.hw.ac.uk/~rjp/bookhtml/ An Introduction to Programming in Simula] A textbook by Rob Pooley now available as HTML


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Simula — ist eine Programmiersprache, die von Ole Johan Dahl und Kristen Nygaard in den 1960er Jahren am Norsk Regnesentral (Norwegisches Rechenzentrum) an der Universität Oslo entwickelt wurde, um Simulationen von z. B. physikalischen Prozessen am… …   Deutsch Wikipedia

  • Simula-67 — Simula ist eine Programmiersprache, die von Ole Johan Dahl und Kristen Nygaard in den 1960er Jahren am Norsk Regnesentral (Norwegisches Rechenzentrum) an der Universität Oslo entwickelt wurde, um Simulationen von z. B. physikalischen Prozessen am …   Deutsch Wikipedia

  • Simula — (Simple universal language) a été créé en 1962 sous la dénomination Simula I par Ole Johan Dahl et Kristen Nygaard à partir d Algol 60. Le langage évolua en 1967 sous le nom de Simula 67 en implantant le premier le modèle de classe de Hoare… …   Wikipédia en Français

  • Simula — es un lenguaje de programación orientada a objetos (OOP). Fue el primero de los lenguajes orientado a objetos. Varios años después de su desarrollo, casi todos los lenguajes modernos comenzaron a utilizar sus principios de orientación a objetos.… …   Wikipedia Español

  • Simula — 67 Семантика: объектно ориентированный Тип исполнения: компилятор Появился в: 1967 г. Автор(ы): Кристен Нюгор и Уле Йохан Даль Типизация данных: статическая Основные реализации: Cim Испытал влияни …   Википедия

  • Simula 67 — Семантика: объектно ориентированный Тип исполнения: компилятор Появился в: 1967 г. Автор(ы): Кристен Нюгор и Уле Йохан Даль Типизация данных: статическая Основные реализации: Cim Испытал влияни …   Википедия

  • simula — SIMULÁ, simulez, vb. I. tranz. A face să pară adevărat ceva ireal; a da, în mod intenţionat, o impresie falsă. ♦ A se preface bolnav, nebun, beat etc. (pentru a obţine un avantaj sau a evita o sancţiune). – Din fr. simuler, lat. simulare. Trimis… …   Dicționar Român

  • SIMULA —   [Kurzwort aus englisch simulation language], Informatik: in den Jahren 1960 67 aus ALGOL 60 entwickelte höhere Programmiersprache mit speziellen Möglichkeiten zur Durchführung von Simulationen auf Rechnersystemen. Das wichtigste mit SIMULA… …   Universal-Lexikon

  • Simula —   [Abk. für Simulation Language, dt. »Simulationssprache«], imperative Programmiersprache mit speziellen Möglichkeiten zur ereignisorientierten Simulation von Abläufen (Prozessen). Die Sprache wurde 1967 in Norwegen auf Basis von Algol 60… …   Universal-Lexikon

  • Simula — es el primer lenguaje de programación orientada a objetos (OOP) que luego de varios años de su desarrollo, casi todos los lenguajes modernos comenzaron a utilizar sus principios de orientación a objetos. Así fue como se popularizaron términos… …   Enciclopedia Universal

  • SIMULA — das; s Kurzw. aus engl. simulation language> auf dem ↑ALGOL aufbauende höhere Programmiersprache mit speziellen Möglichkeiten zur Durchführung von Simulationen auf digitalen Datenverarbeitungsanlagen (EDV) …   Das große Fremdwörterbuch

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”