Simula programming language
This presentation is the property of its rightful owner.
Sponsored Links
1 / 20

Simula Programming Language PowerPoint PPT Presentation


  • 160 Views
  • Uploaded on
  • Presentation posted in: General

Simula Programming Language. Lenar Uri T. Barcelona. It all started with a need…. Kristen Nygaard realized, through his work in the Norwegian Defense Research Establishment, that there is a need for simulation tools. It all started with a need….

Download Presentation

Simula Programming Language

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Simula programming language

Simula Programming Language

Lenar Uri T. Barcelona


It all started with a need

It all started with a need…

  • Kristen Nygaard realized, through his work in the Norwegian Defense Research Establishment, that there is a need for simulation tools


It all started with a need1

It all started with a need…

  • Nygaard left NDRE and put up NCC (Norwegian Computing Center) where, similar to his previous job, he realized that there is a need for simulation tools


History of simula

Summer 1961-Fall 1962

The concept of a mathematical discrete event network and programming language reasoning for Simula I were developed by Nygaard and Dahl

Fall 1962-September 1963

It was decided that Simula I would be implemented as a simulation procedure package along with a preprocessor to Algol 60

History of Simula


History of simula1

September 1963 - March 1964

A new storage management scheme

Simula I would be implemented through a modification and extension of Univac's Algol 60 compiler

March 1964-December 1964

The first prototype was completed in December

Minor language modifications were made

Extensions based on implementation experience and programming test cases were completed

History of Simula


History of simula2

Fall of 1965

The Technical University of Norway wanted to implement a new Algol 60 compiler on the Univac 1100 series

Nygaard and Dahl determined that attribute accessing and common properties of processes were the most significant problems in Simula I

December 1966

Prefixing

Today, prefixing is known as inheritance

Class Concept

Prefixing can be extended to include multiple prefixing thus establishing hierarchies of process classes

This led to the idea of objects

History of Simula


Features of simula

Classes

Objects

instance variables

methods

Inheritance

Sub-typing

“Inner”

supports method combination

"Virtual" methods

methods that can be redefined in derived classes

Inspect/QUA

run-time class (type) tests

Encapsulation

"Protected" which means that they are accessible for subclasses

"Hidden" in which case that are not accessible to subclasses either

Features of Simula


Extensions modifications of algol 60

Extensions/Modifications of Algol 60

  • Added:

    • Class concepts and reference-variables (pointers to objects)

    • Pass-by-reference

    • Char, Text, and I/O

    • Co-routines

  • Removed:

    • Changed default parameter passing mechanism from call-by-name to pass-by-value

    • Pass-by-result

    • Some variable initialization requirements

    • String type (in favor of "text" type)


Problems with simula

Language features:

Limited file access facilities

Missing data types (records, sets)

No real time support

No GUI support

Long executable files for short programs

OOP features:

No multiple inheritance

No interfaces

Simulation:

No automatic collection of statistics

No report generator

No specialized facilities

Problems with Simula


Implicit conversion

Implicit conversion is performed, where necessary, each time a term-operator-term triple is evaluated

General Rules

If the operator is integer divide, //, both terms must be integer or short integer; use of reals or long reals constitutes a runtime error

Implicit Conversion


Implicit conversion1

All short integer values are converted to integer; this can never cause a conversion error

If the operator is real divide, /, both terms are converted to real or long real, in accordance with (4)

Where the terms are of different types and at least one is real or long real conversion is performed; if one term is long real the other is converted to long real otherwise the non-real term is converted to real

Implicit Conversion


Operators in simula

Operators in Simula


Relational operators in simula

Relational Operators in Simula


Simple types in simula

Simple Types in Simula


Syntax rules blocks

Syntax Rules - Blocks

begin     comment Our first SIMULA program;     integer Count;     count := 3;     OutInt(Count,4);     OutImage end


Syntax rules declarations

Syntax Rules - Declarations

procedure PrintTimes(T1, count); text T1; integer count;begin   integer i;   i := 0;   while i < count do   begin      OutText(T1);      OutImage;   end;end;


Syntax rules declarations1

Syntax Rules - Declarations

class HelloWorld;begin   text outPut;   outPut :- "Hello World";   procedure sayHello;   begin      OutText(outPut);   end;end;


Syntax rules recursion

Syntax Rules - Recursion

begin   procedure factorial(m); integer m;   begin      if m > 0 then      begin         factorial := m * factorial(m-1);      end;      else         factorial := 1;   end;   OutInt(factorial(5),4);end


Syntax rules if then else

Syntax Rules – if then else

integer count, countAgain;

count := 2;

countAgain := 3;

if count = 2 then   begin      if countAgain = 3 then         OutText("I will be printed");   end;


Syntax rules while

Syntax Rules - while

integer count;

count := 0;

while count < 10 do   begin      OutInt(count, 4);      OutImage;      count := count + 1;   end;


  • Login