1 / 20

Simula Programming Language

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….

tariana
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simula Programming Language Lenar Uri T. Barcelona

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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)

  9. 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

  10. 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

  11. 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

  12. Operators in Simula

  13. Relational Operators in Simula

  14. Simple Types in Simula

  15. Syntax Rules - Blocks begin     comment Our first SIMULA program;     integer Count;     count := 3;     OutInt(Count,4);     OutImage end

  16. 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;

  17. Syntax Rules - Declarations class HelloWorld;begin   text outPut;   outPut :- "Hello World";   procedure sayHello;   begin      OutText(outPut);   end;end;

  18. 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

  19. 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;

  20. Syntax Rules - while integer count; count := 0; while count < 10 do   begin      OutInt(count, 4);      OutImage;      count := count + 1;   end;

More Related