All Topics  
Simula

 

   Email Print
   Bookmark   Link






 

Simula



 
 
Simula is a name for two programming languages, Simula I and Simula 67, developed in the 1960s at the Norwegian Computing Center
Norwegian Computing Center

Norwegian Computing Center is a private, independent, non-profit research foundation founded in 1952. NR carries out contract research and development in the areas of computing and quantitative methods for a broad range of Industry, commerce and Public services organisations in the national and international markets....
 in Oslo
Oslo

is the Capital and largest List of cities in Norway in Norway.Metropolitan Oslo or the Greater Oslo Region makes up the third largest urban area in Scandinavia after Metropolitan Stockholm and Metropolitan Copenhagen....
, by Ole-Johan Dahl
Ole-Johan Dahl

Ole-Johan Dahl was a Norway computer scientist and is considered to be one of the fathers of Simula and object-oriented programming along with Kristen Nygaard....
 and Kristen Nygaard
Kristen Nygaard

Kristen Nygaard was a Norway mathematician, computer programming language pioneer and politician. He was born in Oslo and died of a myocardial infarction in 2002....
. Syntactically
Syntax

In linguistics, syntax is the study of the principles and rules for constructing Sentence s in natural languages. In addition to referring to the discipline, the term syntax is also used to refer directly to the rules and principles that govern the sentence structure of any individual language, as in "the Irish syntax"....
, it is a fairly faithful superset of Algol 60.

Simula 67 introduced objects, classes
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
, subclasses
Subclass (computer science)

In object-oriented programming, a subclass is a class that Inheritance some properties from its superclass .You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":...
, virtual methods
Virtual function

In object-oriented programming, a virtual function or virtual method is one whose behavior can be Method overriding within an inheriting class by a function with the same Method signature....
, coroutine
Coroutine

In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming of execution at certain locations....
s, discrete event simulation
Discrete Event Simulation

In discrete time-event simulation, the operation of a system is represented as a chronological sequence of Event . Each event occurs at an instant in time and marks a change of state in the system ....
, and features garbage collection
Garbage collection (computer science)

In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage , or memory used by Object that will never be accessed or mutated again by the Application software....
.

Simula is considered the first object-oriented programming
Programming paradigm

A programming paradigm is a fundamental style of computer programming. . Paradigms differ in the concepts and abstractions used to represent the elements of a program and the steps that compose a computation ....
 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
Very-large-scale integration

Very-large-scale integration is the process of creating integrated circuits by combining thousands of transistor-based circuits into a single chip....
 designs, process
Process

Process may refer to:Biology*Process , a projection or outgrowth of tissue from a larger body* Biological processScience and technnology*Process , a computer program or an instance of a program running concurrently with other programs...
es, protocols
Protocol (computing)

In computer science, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints....
, algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
s, and other applications such as typesetting
Typesetting

Typesetting involves the presentation of textual material in graphic form on paper or some other Recording medium. Before the advent of desktop publishing, typesetting of printed material was produced in print shops by compositors or typesetters working by hand, and later with machines....
, computer graphics
Computer graphics

Computer graphics are graphics created by computers and, more generally, the representation and manipulation of pictorial data by a computer....
, and education
Education

File:Inukshuk Monterrey 1.jpgEducation can be seen as a product or a process and considered in a broad sense or a technical sense. According to philosophy of education George F....
.






Discussion
Ask a question about 'Simula'
Start a new discussion about 'Simula'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Simula is a name for two programming languages, Simula I and Simula 67, developed in the 1960s at the Norwegian Computing Center
Norwegian Computing Center

Norwegian Computing Center is a private, independent, non-profit research foundation founded in 1952. NR carries out contract research and development in the areas of computing and quantitative methods for a broad range of Industry, commerce and Public services organisations in the national and international markets....
 in Oslo
Oslo

is the Capital and largest List of cities in Norway in Norway.Metropolitan Oslo or the Greater Oslo Region makes up the third largest urban area in Scandinavia after Metropolitan Stockholm and Metropolitan Copenhagen....
, by Ole-Johan Dahl
Ole-Johan Dahl

Ole-Johan Dahl was a Norway computer scientist and is considered to be one of the fathers of Simula and object-oriented programming along with Kristen Nygaard....
 and Kristen Nygaard
Kristen Nygaard

Kristen Nygaard was a Norway mathematician, computer programming language pioneer and politician. He was born in Oslo and died of a myocardial infarction in 2002....
. Syntactically
Syntax

In linguistics, syntax is the study of the principles and rules for constructing Sentence s in natural languages. In addition to referring to the discipline, the term syntax is also used to refer directly to the rules and principles that govern the sentence structure of any individual language, as in "the Irish syntax"....
, it is a fairly faithful superset of Algol 60.

Simula 67 introduced objects, classes
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
, subclasses
Subclass (computer science)

In object-oriented programming, a subclass is a class that Inheritance some properties from its superclass .You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":...
, virtual methods
Virtual function

In object-oriented programming, a virtual function or virtual method is one whose behavior can be Method overriding within an inheriting class by a function with the same Method signature....
, coroutine
Coroutine

In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming of execution at certain locations....
s, discrete event simulation
Discrete Event Simulation

In discrete time-event simulation, the operation of a system is represented as a chronological sequence of Event . Each event occurs at an instant in time and marks a change of state in the system ....
, and features garbage collection
Garbage collection (computer science)

In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage , or memory used by Object that will never be accessed or mutated again by the Application software....
.

Simula is considered the first object-oriented programming
Programming paradigm

A programming paradigm is a fundamental style of computer programming. . Paradigms differ in the concepts and abstractions used to represent the elements of a program and the steps that compose a computation ....
 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
Very-large-scale integration

Very-large-scale integration is the process of creating integrated circuits by combining thousands of transistor-based circuits into a single chip....
 designs, process
Process

Process may refer to:Biology*Process , a projection or outgrowth of tissue from a larger body* Biological processScience and technnology*Process , a computer program or an instance of a program running concurrently with other programs...
es, protocols
Protocol (computing)

In computer science, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between computing endpoints....
, algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
s, and other applications such as typesetting
Typesetting

Typesetting involves the presentation of textual material in graphic form on paper or some other Recording medium. Before the advent of desktop publishing, typesetting of printed material was produced in print shops by compositors or typesetters working by hand, and later with machines....
, computer graphics
Computer graphics

Computer graphics are graphics created by computers and, more generally, the representation and manipulation of pictorial data by a computer....
, and education
Education

File:Inukshuk Monterrey 1.jpgEducation can be seen as a product or a process and considered in a broad sense or a technical sense. According to philosophy of education George F....
. Since Simula-type objects are reimplemented in C++
C++

C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
, Java
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
 and C# the influence of Simula is often understated. The creator of C++, Bjarne Stroustrup
Bjarne Stroustrup

Bjarne Stroustrup is a computer scientist at the College of Engineering Chair Professor of Computer Science at Texas A&M University. He is most notable for developing the C++ programming language....
, 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
BCPL

BCPL is a computer programming language designed by Martin Richards of the University of Cambridge in 1966....
.

History


Kristen Nygaard
Kristen Nygaard

Kristen Nygaard was a Norway mathematician, computer programming language pioneer and politician. He was born in Oslo and died of a myocardial infarction in 2002....
 started writing computer simulation programs in 1957. Nygaard saw a need for a better way of describing the heterogeneity and the operation
Instruction (computer science)

In computer science, an instruction is a single operation of a central processing unit defined by an instruction set architecture. In a broader sense, an "instruction" may be any representation of an element of an executable program, such as a bytecode....
 of a system
System

System is a set of interacting or interdependent entities, real or abstract, forming an integrated whole.The concept of an "integrated whole" can also be stated in terms of a system embodying a set of relationships which are differentiated from relationships of the set to other elements, and from relationships between an element of the se...
. 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
Ole-Johan Dahl

Ole-Johan Dahl was a Norway computer scientist and is considered to be one of the fathers of Simula and object-oriented programming along with Kristen Nygaard....
 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
Simulation

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviors of a selected physical or abstract system....
 language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 were set. "SIMULA I" was born, a special purpose programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 for simulating
Simulation

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviors of a selected physical or abstract system....
 discrete event systems.

Kristen Nygaard was invited to Univac
UNIVAC

UNIVAC is the name of a business unit and division of the Remington Rand company formed by the 1950 purchase of the Eckert-Mauchly Computer Corporation, founded four years earlier by ENIAC inventors J....
 late May 1962 in connection with the marketing of their new UNIVAC 1107 computer
UNIVAC 1107

The UNIVAC 1107 was the first member of UNIVAC's UNIVAC 1100/2200 series of computers, introduced in October 1962. Also known as the Thin Film Computer because of its use of thin film memory for its register storage....
. At that visit Nygaard presented the ideas of Simula to Robert Bemer
Bob Bemer

Robert William Bemer was a computer scientist best known for his work at IBM during the late 1950s and early 1960s....
, the director of systems programming at Univac
UNIVAC

UNIVAC is the name of a business unit and division of the Remington Rand company formed by the 1950 purchase of the Eckert-Mauchly Computer Corporation, founded four years earlier by ENIAC inventors J....
. Bemer was a sworn ALGOL
Algol

Algol , known colloquially as the Demon Star, is a bright star in the constellation Perseus . It is one of the best known eclipsing binary, the first such star to be discovered, and also one of the first variable stars to be discovered....
 fan and found the Simula project compelling. Bemer was also chairing a session at the second international conference on information processing hosted by IFIP
International Federation for Information Processing

The International Federation for Information Processing, usually known as IFIP, is an umbrella organization for national societies working in the field of information technology....
. He invited Nygaard, who presented the paper "SIMULA -- An Extension of ALGOL to the Description of Discrete-Event Networks".

Norwegian Computing Center
Norwegian Computing Center

Norwegian Computing Center is a private, independent, non-profit research foundation founded in 1952. NR carries out contract research and development in the areas of computing and quantitative methods for a broad range of Industry, commerce and Public services organisations in the national and international markets....
 got a UNIVAC 1107
UNIVAC 1107

The UNIVAC 1107 was the first member of UNIVAC's UNIVAC 1100/2200 series of computers, introduced in October 1962. Also known as the Thin Film Computer because of its use of thin film memory for its register storage....
 August 1963 at a considerable discount, on which Dahl implemented the SIMULA I under contract with Univac
UNIVAC

UNIVAC is the name of a business unit and division of the Remington Rand company formed by the 1950 purchase of the Eckert-Mauchly Computer Corporation, founded four years earlier by ENIAC inventors J....
. The implementation was based on the UNIVAC
UNIVAC

UNIVAC is the name of a business unit and division of the Remington Rand company formed by the 1950 purchase of the Eckert-Mauchly Computer Corporation, founded four years earlier by ENIAC inventors J....
 Algol 60 compiler. SIMULA I was fully operational on UNIVAC 1107
UNIVAC 1107

The UNIVAC 1107 was the first member of UNIVAC's UNIVAC 1100/2200 series of computers, introduced in October 1962. Also known as the Thin Film Computer because of its use of thin film memory for its register storage....
 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
List of Soviet computer systems

This is the list of Soviet computer systems. The Russian language abbreviation EVM , present in some of the names below, means ???????????? ?????????????? ???????, literally ?electronic computing machine.? See History of computer hardware in Soviet Bloc countries for more....
.

In 1966 C. A. R. Hoare
C. A. R. Hoare

Sir Charles Antony Richard Hoare , commonly known as Tony Hoare or C.A.R. Hoare, is a United Kingdom computer science, probably best known for the development in 1960 of Quicksort , one of the world's most widely used sorting algorithms....
 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
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
 and Subclass
Subclass (computer science)

In object-oriented programming, a subclass is a class that Inheritance some properties from its superclass .You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":...
 Declarations at the IFIP
International Federation for Information Processing

The International Federation for Information Processing, usually known as IFIP, is an umbrella organization for national societies working in the field of information technology....
 Working Conference on simulation languages in Oslo
Oslo

is the Capital and largest List of cities in Norway in Norway.Metropolitan Oslo or the Greater Oslo Region makes up the third largest urban area in Scandinavia after Metropolitan Stockholm and Metropolitan Copenhagen....
, 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
Data type

A data type in programming languages is an attribute of a data which tells the computer something about the kind of data it is. This involves setting constraints on the datum, such as what values it can take and what operations may be performed upon it....
 and the Class
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
 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
Smalltalk

Smalltalk is an Object-oriented programming, Type system, reflection computer programming programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human?computer symbiosis." It was designed and created in part for educational use, more so for constructionist learning, at PARC by Al...
 and later object-oriented programming language
Object-oriented programming language

An object-oriented programming language is one that allows or encourages, to some degree, object-oriented programming techniques such as Information hiding, Inheritance , module , and Polymorphism ....
s. It also helped inspire the Actor model
Actor model

In computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to the next message receiv...
 of concurrent computation although Simula only supports co-routines and not true concurrency
Concurrency

Concurrency, 'concurrent, or concurrence may refer to:* Concurrence, a legal term referring to the need to prove both actus reus and mens rea...
.

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

  • UNIVAC 1100
    UNIVAC

    UNIVAC is the name of a business unit and division of the Remington Rand company formed by the 1950 purchase of the Eckert-Mauchly Computer Corporation, founded four years earlier by ENIAC inventors J....
     by NCC
    Norwegian Computing Center

    Norwegian Computing Center is a private, independent, non-profit research foundation founded in 1952. NR carries out contract research and development in the areas of computing and quantitative methods for a broad range of Industry, commerce and Public services organisations in the national and international markets....
  • System/360
    System/360

    The IBM System/360 is a mainframe computer system family announced by IBM on April 7, 1964. It was the first family of computers making a clear distinction between computer architecture and implementation, allowing IBM to release a suite of compatible designs at different price points....
     and System/370
    System/370

    The IBM System/370 was a model range of IBM mainframes announced on June 30, 1970 as the successors to the System/360 family. The series maintained backward compatibility with the S/360, allowing an easy migration path for customers; this, plus improved performance, were the dominant themes of the product announcement....
     by Swedish Research Institute for National Defence (FOA)
  • CDC 3000
    CDC 3000

    The CDC 3000 series computers from Control Data Corporation were mid-1960s follow-ons to the CDC 1604 and CDC 924 systems. Over time, a range of machines were produced - divided into the 'upper 3000 series' and the 'lower 3000 series'....
     by University of Oslo
    University of Oslo

    The University of Oslo is the List of oldest universities in continuous operation#Oldest Universities by Region .28post 1500.29, largest and most prestigious university in Norway, situated in the Norwegian capital of Oslo....
    's Joint Computer Installation at Kjeller
  • TOPS-10
    TOPS-10

    The TOPS-10 System was a computer operating system from Digital Equipment Corporation for the PDP-10 mainframe computer launched in 1967. TOPS-10 evolved from the earlier "Monitor" software for the PDP-6 and -10 computers; this was renamed TOPS-10 in 1970....
     by ENEA AB
    ENEA AB

    ENEA is a Sweden information technology company with its main office in Kista, Sweden. They work in the area of operating systems and consulting....


These implementations were ported to a wide range of platforms. The TOPS-10
TOPS-10

The TOPS-10 System was a computer operating system from Digital Equipment Corporation for the PDP-10 mainframe computer launched in 1967. TOPS-10 evolved from the earlier "Monitor" software for the PDP-6 and -10 computers; this was renamed TOPS-10 in 1970....
 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
  • GNU Cim - [ftp://ftp.ifi.uio.no/pub/cim/ Download from the University of Oslo ftp site]


In November 2001 Dahl and Nygaard were awarded the IEEE John von Neumann Medal
IEEE John von Neumann Medal

The IEEE John von Neumann Medal was established by the IEEE Board of Directors in 1990 and may be presented annually "for outstanding achievements in computer-related science and technology." The achievements may be theoretical, technological, or entrepreneurial, and need not have been made immediately prior to the date of the award....
 by the Institute of Electrical and Electronic Engineers "For the introduction of the concepts underlying object-oriented programming
Object-oriented programming

Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs....
 through the design and implementation of SIMULA 67". In February 2002 they received the 2001 A. M. Turing Award
Turing Award

The A. M. Turing Award is given annually by the Association for Computing Machinery to "an individual selected for contributions of a technical nature made to the computing community....
 by the Association for Computing Machinery
Association for Computing Machinery

The Association for Computing Machinery, or ACM, was founded in 1947 as the world's first scientific and educational computing society. Its membership was approximately 83,000 as of 2007....
 (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 , scheduled to be delivered at the OOPSLA
OOPSLA

OOPSLA is an annual Association for Computing Machinery conference.OOPSLA is an annual conference covering topics on object-oriented programming systems, languages and applications....
 2002 conference in Seattle, as they both in June and August, respectively.

Simula Research Laboratory
Simula Research Laboratory

Simula Research Laboratory is a Norway research organization, located at Fornebu , which conducts basic research in computer network and distributed systems, scientific computing and software engineering....
 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
Computer file

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
 is the minimal program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 in Simula, measured by the size of the source code
Source code

In computer science, source code is any collection of statements or declarations written in some human-readable computer programming language....
. It consists of one thing only; a dummy statement
Statement (programming)

In computer programming a statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements....
.

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
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 itself.

Classic Hello world

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

A "Hello World" program is a computer program that prints out "Hello world!" on a display device. It is used in many introductory tutorials for teaching a programming language....
 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
Subclass (computer science)

In object-oriented programming, a subclass is a class that Inheritance some properties from its superclass .You can usually think of the subclass as being "a kind of" its superclass, as in a "a Manx is a kind of cat", or "a square is a kind of rectangle":...
 (Char and Line). There is one virtual method with two implementation
Implementation

Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, Standardization, algorithm, or policy....
s. 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
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
 error
Error

The word error has different meanings and usages relative to how it is conceptually applied. The concrete meaning of the Latin word error means "wandering" or "straying"....
.

Call by name


Simula supports call by name so the Jensen's Device
Jensen's Device

Jensen's Device is a computer programming technique devised by Danish computer scientist J?rn Jensen after studying the ALGOL 60 Report.The following program was proposed to illustrate the technique....
 can easily be implemented. However, the default transmission mode for simple parameter is call by name in ALGOL
Algol

Algol , known colloquially as the Demon Star, is a bright star in the constellation Perseus . It is one of the best known eclipsing binary, the first such star to be discovered, and also one of the first variable stars to be discovered....
 but call by value in Simula. The source code for the Jensen's Device
Jensen's Device

Jensen's Device is a computer programming technique devised by Danish computer scientist J?rn Jensen after studying the ALGOL 60 Report.The following program was proposed to illustrate the technique....
 must therefore specify call by name for the parameters when compiled by a Simula compiler.

Another much simpler example is the summation function
Arithmetic function

In number theory, an arithmetic function or arithmetical function is a function defined on the set of natural numbers that takes real or complex values....
 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 variable in a for loop
For loop

In computer science a for loop is a programming language statement which allows code to be repeatedly execution . A for loop is classified as an iteration statement....
. 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 simulation
Simulation

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviors of a selected physical or abstract system....
 package for doing discrete event simulation
Discrete Event Simulation

In discrete time-event simulation, the operation of a system is represented as a chronological sequence of Event . Each event occurs at an instant in time and marks a change of state in the system ....
s. This simulation package is based on Simulas object oriented features and its coroutine
Coroutine

In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming of execution at certain locations....
 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
    Object-oriented programming

    Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs....
  • BETA programming language (a modern successor to Simula)
  • Simulation language
    Simulation language

    A computer simulation language describes the operation of a simulation on a computer. There are two major types of simulation: continuous and Discrete event simulation though more modern languages can handle combinations....
  • ALGOL 60


Source

  • Early history of the development of Simula by Jan Rune Holmevik
  • The Simula Standard and other historical documentation by Peter Sylvester


External links

  • – By J.Sklenar, based on the 1997 seminar "30 Years of Object Oriented Programming (OOP)" at the University of Malta
  • – By Dahl and Nygaard, abbrev. version of an encyclopedia article; on Nygaards home page
  • Includes tutorials, documentation, and links in English and in French
  • A textbook by Rob Pooley now available as HTML