The Evolution of Programming Languages Day 2 Lecturer: Xiao Jia The Evolution of PLs1.

Slides:



Advertisements
Similar presentations
Programming Languages and Paradigms
Advertisements

Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
CS 415: Programming Languages Algol Aaron Bloomfield Fall 2005.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chapter 7:: Data Types Programming Language Pragmatics
CS ExCo Advanced in Topics Object-Oriented Programming.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
ALGOL 60 Design by committee of computer scientists: Naur, Backus, Bauer, McCarthy, van Wijngaarden, Landin, etc. Design by committee of computer scientists:
1 ) Definition 2) Note on structured and modular programming, and information hiding 3) Example imperative languages 4) Features of imperative languages.
Introduction to Fortran Fortran Evolution Drawbacks of FORTRAN 77 Fortran 90 New features Advantages of Additions.
High-Level Programming Languages
A Quick Overview of Languages. FORTRAN Designed in 1955 First release of the compiler in 1957 Algebraic in nature Scientific (numeric not string oriented)
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
6/27/2015G. Levine1 PROGRAMMING LANGUAGES Text: Programming Languages, Design and Implementation Pratt and Zelkowitz 4 th ed. Prentice-Hall.
CSCE 330 Project Algol 68 Joe PuzioWael AL-Fayez Gaurav ShahRonak Patel.
Programming Language Concepts
© 2003 G. Drew Kessler and William M. Pottenger1 Subroutines (Part 1) CSE 262, Spring 2003.
The ALGOL Family Mason Vines CPSC425. Overview ALGOL 58 ALGOL 60 ALGOL 68 Success and Failure of ALGOL.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
The Evolution of the Object Model OOAD. The Evolution of the Object Model software engineering trends observed The shift in focus from programming-in-the-small.
CS 363 Comparative Programming Languages
Static and Dynamic Behavior CMPS Power of OOP Derives from the ability of objects to change their behavior dynamically at run time. Static – refers.
Gary MarsdenSlide 1University of Cape Town Principles of programming language design Gary Marsden Semester 2 – 2001.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
Names Variables Type Checking Strong Typing Type Compatibility 1.
5-1 Chapter 5: Names, Bindings, Type Checking, and Scopes Variables The Concept of Binding Type Checking Strong Typing Type Compatibility Scope and Lifetime.
CS 2104 Prog. Lang. Concepts Subprograms
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Programming Languages and Design Lecture 7 Subroutines and Control Abstraction Instructor: Li Ma Department of Computer Science Texas Southern University,
1 Programming Language History and Evolution In Text: Chapter 2.
1 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Basic Semantics Associating meaning with language entities.
Slide: 1 Copyright © AdaCore Subprograms Presented by Quentin Ochem university.adacore.com.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Ch. 5 Ch. 51 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (more notes) Dr. Carter Tiernan.
Arithmetic Expressions
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
COMP3190: Principle of Programming Languages
CS212: Object Oriented Analysis and Design
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Structure of Programming Languages Names, Bindings, Type Checking, and Scopes.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
Ch. 5 Ch. 51 jcmt Summer 2003Programming Languages CSE3302 Programming Languages (more notes) Summer 2003 Dr. Carter Tiernan.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
1 Structure of Compilers Lexical Analyzer (scanner) Modified Source Program Parser Tokens Semantic Analysis Syntactic Structure Optimizer Code Generator.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
The Evolution of Programming Languages Day 1 Lecturer: Xiao Jia The Evolution of PLs1.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
Programming Language History and Evolution
Functional Programming
CSE3302 Programming Languages (notes continued)
Zuse’s Plankalkül – 1945 Never implemented Problems Zuse Solved
Why study programming languages?
Algol 60 John Cowan N Languages in N Months Meetup June 7, 2016
Structure of Programming Languages
FORTRAN 04 February 1999; CS655.
Programming Language History and Evolution
Ada – 1983 History’s largest design effort
Chapter 7 Expressions and Assignment Statements.
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Programming Languages and Paradigms
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
PRESENTED BY ADNAN M. UZAIR NOMAN
Presentation transcript:

The Evolution of Programming Languages Day 2 Lecturer: Xiao Jia The Evolution of PLs1

In last lecture … Anomalies Theoretical Issues –Type Theory –REs and Control/Data Structures The Evolution of PLs2

The Procedural Paradigm The Evolution of PLs3

Early Days LocationOrder 100A A2 102T H24 104C50 105T104 The Evolution of PLs4 (address 104)

Early Days Aa3 A2 T H24 a3)C50 Ta3 The Evolution of PLs5 (symbol a3)

FORTRAN 1957 IBM John Backus The Evolution of PLs6

“The IBM Mathematical Formula Translation System or briefly, FORTRAN, will comprise a large set of programs to enable the IBM 704 to accept a concise formulation of a problem in terms of a mathematical notation and to produce automatically a high-speed 704 program for the solution of the problem.” The Evolution of PLs7

Major Achievements efficient compilation separate compilation (programs as separate subroutines, but the compiler doesn’t check for consistency between components) demonstration that high-level programming, with automatic translation to machine code, is feasible The Evolution of PLs8

Principal Limitations Flat, uniform structure –no concept of nesting Limited control structures –no compound statements Unsafe memory allocation –do NOT check consistent usage of memory No recursion –allocate data statically The Evolution of PLs9

Exercise The FORTRAN 1966 Standard stated that a FORTRAN implementation may allow recursion but is not required to do so. How would you interpret this statement if you were: (i) writing a FORTRAN program? (ii) writing a FORTRAN compiler? The Evolution of PLs10

Algol 60 Goal: universal PL Algol was a failure –few compilers, not widely used Algol was a success –standard language for describing algorithms The Evolution of PLs11

Major Innovations Block Structure –block: introduce nested scopes –runtime entity: activation record (AR) on stack Dynamic Arrays (discussed later) –dope vector: a pointer and an integer (size) Call By Name (discussed later) Own Variables –keyword: own –analogy: static in C++ (within a function) The Evolution of PLs12

Exercise Own Variables: local scope global extent Discuss the initialization of own variables. The Evolution of PLs13

Dynamic Arrays procedure average (n); integer n; begin real array a[1:n]; … end; The Evolution of PLs14

Call By Name procedure count (n); integer n; begin n := n + 1 end count(widgets)  begin widgets := widgets + 1 end The Evolution of PLs15

Call By Name integer procedure sum (max, i, val); integer max, i, val; begin integer s; s := 0; for i := 1 until n do s := s + val; sum := s end The Evolution of PLs16 sum(3, i, a[i]) computes a[1]+a[2]+a[3]

Call By Name try(x > 0, 1.0 / x) The Evolution of PLs17

Call By Name try(x > 0, 1.0 / x) real procedure try(b, x); boolean b; real x; begin try := if b then x else 0.0 end The Evolution of PLs18

Exercise integer procedure sum (max, i, val); integer max, i, val; begin integer s; s := 0; for i := 1 until n do s := s + val; sum := s end The Evolution of PLs19 sum(3, i, a[i]) computes a[1]+a[2]+a[3] Why does i appear in the parameter list of sum?

Missed Interesting Opportunities An Algol block without statements is, in effect, a record –Yet Algol 60 doesn’t provide records The Evolution of PLs20

Missed Interesting Opportunities An Algol block: –begin Declarations Statements –end A natural interpretation of concurrency: –begin D 1 S 1 D 2 S 2 end The Evolution of PLs21

Missed Interesting Opportunities Own variables: separation of scope and extent Ultimately lead to objects The Evolution of PLs22

Missed Interesting Opportunities Call By Name: first step towards the idea that functions can be treated as values Actual parameters are implemented as Algol calls of parameter-less procedures Apply the idea consistently throughout the language  high order functions, and functional programming The Evolution of PLs23

The Algol committee knew what they were doing “Missed opportunities” would have led to significant implementation problems The Evolution of PLs24

COBOL COmmon Business-Oriented Language structured data implicit type conversion MOVE X to Y. The Evolution of PLs25

Example: Automatic conversion SALARY PICTURE 99999, USAGE IS COMPUTATIONAL SALREP PICTURE $$$,$$9.99 MOVE SALARY TO SALREP. The Evolution of PLs26

Exercise Despite significant advances in the design and implementation of PLs, it remains true that FORTRAN is widely used for “number crunching”, and COBOL is widely used for data processing Explain why. The Evolution of PLs27

PL/I Design principles: (i) contain features for all kinds of programming (ii) only have to learn a subset of the language The Evolution of PLs28

PL/I is a failure A programmer who has learned a “subset” of PL/I is likely to make a mistake The Evolution of PLs29

Example: Automatic conversion (‘57’ || 8) Convert integer 8 to string ‘8’ 2.Concatenate strings ‘57’ and ‘8’  ‘578’ 3.Convert string ‘578’ to integer Add 17 to 578  Convert integer 595 to string ‘595’ The Evolution of PLs30

Features Storage class: static, automatic, based, controlled Programmer-defined types (but could NOT be named) Exception handling ON condition BEGIN; … END; The Evolution of PLs31 OVERFLOW PRINTER OUT OF PAPER

Algol 68 Design principle: orthogonality The language is to be defined using a number of basic concepts that could be combined in arbitrary ways. The Evolution of PLs32

Features Described in formal notation (contribute to the slow acceptance of the language) Operator overloading (even priority can be altered) Very uniform notation for declarations and other entities: mode name = expression Reference Large vocabulary of PL terms The Evolution of PLs33

Pascal Demonstrate that a PL could be simple yet powerful Data types form a recursive hierarchy (as blocks do in Algol 60) NO implicit type conversions A kind of “fill in the blanks” language – stepwise refinement –but prevents independent compilation The Evolution of PLs34

Modula-2 inherits Pascal’s strengths (to some extent) removes Pascal’s weaknesses Important Features: (i) Modules (interface, implementation) (ii) Coroutines The Evolution of PLs35 HOMEWORK

C Very pragmatic PL Notable for its concise syntax Contribution: POPULARITY the spread of UNIX inevitably led to the spread of C The Evolution of PLs36

Ada represents the last major effort in procedural PL design procedure procname ( parameters ) is body type recordtype ( parameters ) is body The Evolution of PLs37

generic ( parameters ) package packagename is package description task type templatename is task description The Evolution of PLs38

generic max: integer; type element is private; package Stack is … package intStack is new Stack(20, integer) The Evolution of PLs39

Exercise Propose a uniform style for Ada declarations The Evolution of PLs40 HOMEWORK