Simula Programming Language Lenar Uri T. Barcelona.

Slides:



Advertisements
Similar presentations
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Advertisements

Chapter 3: Modules, Hierarchy Charts, and Documentation
Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Object Oriented Programming Chapter 7 Programming Languages by Ravi Sethi.
Chapter 10.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
1 Chapter 4 Language Fundamentals. 2 Identifiers Program parts such as packages, classes, and class members have names, which are formally known as identifiers.
High-Level Programming Languages
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
JavaScript, Third Edition
CSci 142 Data and Expressions. 2  Topics  Strings  Primitive data types  Using variables and constants  Expressions and operator precedence  Data.
C++ fundamentals.
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
COMPUTER SCIENCE I C++ INTRODUCTION
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Programming Languages and Paradigms Object-Oriented Programming.
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
 Value, Variable and Data Type  Type Conversion  Arithmetic Expression Evaluation  Scope of variable.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Data Structures Using C++ 2E1 Inheritance An “is-a” relationship –Example: “every employee is a person” Allows new class creation from existing classes.
Fortran 77 By Tanatorn Somboonvorakit, ID:
Chapter 12 Support for Object oriented Programming.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
The Evolution of Programming Languages Day 2 Lecturer: Xiao Jia The Evolution of PLs1.
C++ Lecture 1 Friday, 4 July History of C++ l Built on top of C l C was developed in early 70s from B and BCPL l Object oriented programming paradigm.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Copyright Curt Hill Variables What are they? Why do we need them?
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Interfaces About Interfaces Interfaces and abstract classes provide more structured way to separate interface from implementation
Ole-Johan Dahl ACM Turing Award (2001) Presentation by Carsten Hood CSCE | Spring 2014.
Principles of programming languages 10: Object oriented languages Isao Sasano Department of Information Science and Engineering.
Object Oriented Software Development 4. C# data types, objects and references.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
CPS120: Introduction to Computer Science Variables and Constants.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Programming With Java ICS201 University Of Ha’il1 ICS 201 Introduction to Computer Science Inheritance.
Object Oriented Programming in
Principles of programming languages 10: Object oriented languages
Programming paradigms
7.1 What Is An Object Object-oriented program - Description or simulation of application Object-oriented programming is done by adopting or extending an.
Java Primer 1: Types, Classes and Operators
Multiple variables can be created in one declaration
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
C Basics.
Programmazione I a.a. 2017/2018.
Java Programming Language
Chapter 3: Selection Structures: Making Decisions
Chapter 3: Selection Structures: Making Decisions
An Overview of C.
Presentation transcript:

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 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… 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 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 Fall 1962 Summer Fall 1962 The concept of a mathematical discrete event network and programming language reasoning for Simula I were developed by Nygaard and Dahl The concept of a mathematical discrete event network and programming language reasoning for Simula I were developed by Nygaard and Dahl Fall September 1963 Fall 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 September March 1964 September March 1964 A new storage management scheme A new storage management scheme Simula I would be implemented through a modification and extension of Univac's Algol 60 compiler Simula I would be implemented through a modification and extension of Univac's Algol 60 compiler March December 1964 March 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 Fall of 1965 Fall of 1965 The Technical University of Norway wanted to implement a new Algol 60 compiler on the Univac 1100 series 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 Nygaard and Dahl determined that attribute accessing and common properties of processes were the most significant problems in Simula I December 1966 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

Features of Simula Classes Classes Objects Objects instance variables instance variables methods methods Inheritance Inheritance Sub-typing Sub-typing “Inner” “Inner” supports method combination supports method combination "Virtual" methods "Virtual" methods methods that can be redefined in derived classes Inspect/QUA Inspect/QUA run-time class (type) tests Encapsulation Encapsulation "Protected" which means that they are accessible for subclasses "Hidden" in which case that are not accessible to subclasses either

Extensions/Modifications of Algol 60 Added: Added: Class concepts and reference-variables (pointers to objects) Class concepts and reference-variables (pointers to objects) Pass-by-reference Pass-by-reference Char, Text, and I/O Char, Text, and I/O Co-routines Co-routines Removed: Removed: Changed default parameter passing mechanism from call-by-name to pass-by-value Changed default parameter passing mechanism from call-by-name to pass-by-value Pass-by-result Pass-by-result Some variable initialization requirements Some variable initialization requirements String type (in favor of "text" type) String type (in favor of "text" type)

Problems with Simula Language features: Language features: Limited file access facilities Limited file access facilities Missing data types (records, sets) Missing data types (records, sets) No real time support No real time support No GUI support No GUI support Long executable files for short programs Long executable files for short programs OOP features: OOP features: No multiple inheritance No interfaces Simulation: Simulation: No automatic collection of statistics No report generator No specialized facilities

Implicit Conversion Implicit conversion is performed, where necessary, each time a term- operator-term triple is evaluated Implicit conversion is performed, where necessary, each time a term- operator-term triple is evaluated General Rules General Rules 1. 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 2. All short integer values are converted to integer; this can never cause a conversion error 3. If the operator is real divide, /, both terms are converted to real or long real, in accordance with (4) 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

Operators in Simula OperatorExample Exponentiation**2**5 = 32 Multiplication*2*5 = 10 Division of real numbers /2/5 =.4 Division of integers //2/5 = 0 Addition+2+5 = 7 Subtraction-2-5 = -3

Relational Operators in Simula SymbolAlternativeMeaning =eqis equal to <>neis not equal to >gtis greater than <ltis less than >=ge is greater than or equal to <=le is less than or equal to

Simple Types in Simula KeywordInitial ValueDescription integer0 Any integer value, positive or negative. short integ er 0 real0.0 Any decimal value, positive or negative. long0.0 characterISO NULLAny single character. BooleanFalse Can only hold one of two values, True or False. text NoText, equivalent to "" Any string.

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

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 - Declarations class HelloWorld; begin text outPut; outPut :- "Hello World"; procedure sayHello; begin OutText(outPut); end; end;

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 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 integer count; count := 0; while count < 10 do begin OutInt(count, 4); OutImage; count := count + 1; end;