Lecture 2. A Historical View

Similar documents
COP4020 Programming Languages. Introduction Prof. Robert van Engelen

Comp 333: Concepts of Programming Languages Fall 2016

Software II: Principles of Programming Languages

Introduction. A. Bellaachia Page: 1

Chapter 2. 5 * B => A V 6 7 (subscripts) S 1.n 1.n (data types)

Language Translation, History. CS152. Chris Pollett. Sep. 3, 2008.

Low-Level Languages. Computer Programs and Programming Languages

1/14/2014. Introduction to CSE 1325 Object Oriented Programming (Using Java) Introduction (Cont.) Introduction

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

2. Evolution of the Major Programming languages

Chapter 2. Chapter 2

Fundamentals of Programming Languages. PL families Lecture 02 sl. dr. ing. Ciprian-Bogdan Chirila

Chapter 2. Evolution of the Major Programming Languages

Chapter 2. Evolution of the Major Programming Languages

Principles of Programming Languages. Lecture Outline

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Evolution of the Major Programming Languages

Introduction to Java. Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.

Introduction to Programming

Chapter 2. Evolution of the Major Programming Languages ISBN

Chapter 2. Pseudocodes: Speedcoding. 2.2 Minimal Hardware Programming: Pseudocodes. Evolution of the Major Programming Languages

Programming Languages CMSC 4023 Chapter 2

Chapter 2 Evolution of the Major Programming Languages Chapter 2 Topics

Chapter 2. Evolution of the Major Programming Languages ISBN

Discovering Computers 2008

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Lesson 01 Introduction

Introduction to Computers, the Internet and the Web Pearson Education, Inc. All rights reserved.

Evolution of PL s. EECS 476, Prog. Lang. Design/ page 1

Programmiersprachen (Programming Languages)

Principles of Programming Languages

CSC 533: Organization of Programming Languages. Spring 2005

Logic Programming II & Revision

Simula. Where Would We Be Without It? By Joe Casey

8/23/18. Programming Language Genealogy The Evolution of Programming Languages. Zuse s Plankalkül. Plankalkül Syntax. Machine Code

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Structured Languages. Rahul Deodhar

CSE 452: Programming Languages. Outline of Today s Lecture. Expressions. Expressions and Control Flow

CS 430 Spring History of Programming Languages. Mike Lam, Professor. John McCarthy ( ) Inventor of LISP

Informatica 3 Syntax and Semantics

Lecturer: William W.Y. Hsu. Programming Languages

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

CS2303 C14 Systems Programming Concepts. Bob Kinicki

NOTE: Answer ANY FOUR of the following 6 sections:

COSC 2P90 Programming Languages & Object-Orientation

Chapter 1 Introduction to Computers, Programs, and Java

CSCI312 Principles of Programming Languages!

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

Answer: Early binding generally leads to greater efficiency (compilation approach) Late binding general leads to greater flexibility

Attributes, Bindings, and Semantic Functions Declarations, Blocks, Scope, and the Symbol Table Name Resolution and Overloading Allocation, Lifetimes,

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Programming Languages, Summary CSC419; Odelia Schwartz

Chapter 7. Expressions and Assignment Statements ISBN

Chapter 8 ( ) Control Abstraction. Subprograms Issues related to subprograms How is control transferred to & from the subprogram?

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

Lecture 1: Overview of Java

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program

Final-Term Papers Solved MCQS with Reference

Chapter 1. Preliminaries

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

Homework #3 CS2255 Fall 2012

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

CSCI.4430/6969 Programming Languages Lecture Notes

Expressions & Assignment Statements

Scientific Computing

Chapter 11 Introduction to Programming in C

The results for a few specific cases below are indicated. allequal ([1,1,1,1]) should return true allequal ([1,1,2,1]) should return false

Programming Language Concepts 1982, 1987, Outline. Period

OOPs: The Harsh Realities of Programming

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current

Programming Paradigms

Lecture 1: Introduction to Java

Connecting with Computer Science, 2e. Chapter 15 Programming II

Lecturer: William W.Y. Hsu. Programming Languages

Is it ever useful to be confident that a problem is hard?

Chapter 11 Introduction to Programming in C

LECTURE 18. Control Flow

2 rd class Department of Programming. OOP with Java Programming

Chapter 7. Expressions and Assignment Statements (updated edition 11) ISBN

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Subprograms. Bilkent University. CS315 Programming Languages Pinar Duygulu

Lecture 1: CS2400 Introduction to Computer Science

CS 113: Introduction to

CS 376b Computer Vision

Chapter 5 Names, Binding, Type Checking and Scopes

Chapter 1. Preliminaries

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

CS 314 Principles of Programming Languages

Chapter 1 Preliminaries

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

AN OVERVIEW OF C++ 1

CS558 Programming Languages

Continuations provide a novel way to suspend and reexecute

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Fundamentals of Programming Languages. Data Types Lecture 07 sl. dr. ing. Ciprian-Bogdan Chirila

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

Chapter 7 Expressions and Assignment statements

Transcription:

Lecture 2 A Historical View Hardware Programming Short Code (John Mauchly, 1949) for UNIVAC I; two-six-bit byte instructions; implemented as a pure interpreter FORTRAN Previous all floating point calculations implemented in software. IBM 704 developed which included floating point hardware. FORTRAN (FORmula TRANlator) developed as the first compiled language. FORTRAN I (1956) Writing compiler an expensive process. FORTRAN II (1958) FORTRAN 77 FORTRAN 90 FORTRAN Evaluation: Long use; heavy investment in FORTRAN software; extremely efficient compilers; large mathematical libraries Example (Sebesta) C FORTRAN 90 EXAMPLE PROGRAM C INPUT: AN INTEGER, LIST_LEN C WHERE LIST_LEN IS LESS THAN C 100, FOLLOWED BY LIST_LEN-INTEGER C VALUES C OUTPUT: THE NUMBER OF INPUT VALUES C THAT ARE GREATER THAN THE AVERAGE C OF AL LINPUT VALUES INTEGER INTLIST(99) INTEGER LIST_LEN, COUNTER, SUM, AVERAGE, RESULT RESULT = 0 SUM = 0 READ *, LIST_LEN IF ((LIST_LEN.GT. 0).AND. (LIST_LEN.LT. 100)) THEN C READ INPUT DATA INTO AN ARRAY AND COMPUTE ITS SUM DO 10 COUNTER = 1, LIST_LEN READ *, INTLIST(COUNTER) SUM = SUM + INTLIST(COUNTER) 10 CONTINUE C COMPUTER THE AVERAGE DO 20 COUNTER = 1, LIST_LEN IF ( INTLIST(COUNTER).GT. AVERGE) THEN

RESULT = RESULT + 1 END IF 20 CONTINUE C PRINT THE RESULT PRINT *, 'NUMBER OF VALUES > AVERAGE IS: ', RESULT ELSE PRINT *, 'ERROR-LIST LENGTH VALUE IS NOT LEGAL' END IF STOP END Functional Programming LISP (John McCarthy, 1958) MIT: LISt Processor Need for an artificial intelligence language that would process symbolic language in linked lists - and to handle recursion. Scheme (more details later in the course) is a descendant of LISP developed at MIT in the mid-1970's. ALGOL Stemming out of a move to create a universal programming language and some fear of IBM dominants; ALGOL (ALGOrithmic Language) was designed. It emphasized the concept of block structures allowing localization of code. It broadened the means of parameter passing methods. It was also easily defined using BNF (more later). (From Sebesta) comment ALGOL 60 Example Program Input: An integer, listlen, where listlen is less than 100, followed by listlen-integer values Output: The number of input values that are greater than the average of all the input values ; integer array intlist[1:99]; integer listlen, counter, sum, averge, result; sum := 0; result :=0; readint (listlen); if (listlen > 0) ^ (listlen < 100) then comment Read input into an array and computer the average; for counter := 1 step 1 until listlen do readint (intlist[counter]); sum := sum + intlist[counter];

end; comment Computer the average; average := sum / listlen; comment Count the input values that are > average; for counter := 1 step 1 until listlen do if intlist[counter] > average then result := result + 1; comment Print result; printstring("the number of values > average is: "); printint (result); end printstring ("Error-input list length is not legal"); end COBOL COBOL (COmmon Business Oriented Language) has been used more than any other programming language; yet, it has had little or no direct influence on the design of new languages. Designed in 1959 it was to assist in data manipulation. Program sections are divided into a DATA DIVISION to describe the data to be manipulated and a PROCEDURE DIVISION to manipulate the data. BASIC Designed (1964) at Dartmouth College BASIC (Beginners All-purpose Symbolic Instruction Code) was primarily designed as a language for learning programming. It was an interpreted language for years. (From Sebesta) REM QuickBASIC Example Program REM Input: An integer, listlen, where listlen is less REM than 100, followed by listlen-integer values REM Output: The number of input values that are REM greater than the average of all input values DIM intlist(99) result = 0 sum = 0 INPUT listlen IF listlen > 0 AND listlen < 100 THEN REM Read input into an array and computer the sum FOR counter = 1 TO listlen INPUT intlist(counter) sum = sum + intlist(counter) NEXT counter

REM Compute the average average = sum / listlen REM Count the number of input values that are > average FOR counter = 1 to listlen IF intlist(counter) > average THEN result = result + 1 NEXT counter REM Print the result PRINT "The number of values that are > average is : "; result ELSE PRINT "Error-input list length is not legal" END IF END PL/1 PL/1 (Programming Language 1, 1965, IBM) Designed as a combination of the best of FORTRAN and ALGOL. Programs can develop concurrently executing tasks, had extensive exception-handling, recursive procedures, pointers as a data type, and referencing of array cross-sections. APL APL (A Programming Language, 1975) Interpreted. Has very high level mathematical operators. SNOBOL SNOBOL ("Snowball", 1971) Was designed as language for text editing. Pascal Pascal (1971) was designed primarily by Niklaus Wirth. Introduced the case statement and records. It's greatest impact is on programming education. (Partially from Sebesta) {Pascal Example Program Input: An integer, listlen, where listlen is less than 1000, followed by listlen-integer values Output: The number of input values that are greater than the average of all input values program pasex (input, output); type intlisttype = array [1..99] of integer; var

end. C intlist : intlistytpe; listlen, counter, sum, average, result : integer; result := 0; sum := 0; readln( listlen ); if ((listlen > 0) and (listlen < 100) then for counter := 1 to listlen do readln(intlist[counter]); sum := sum + intlist[counter) end {Computer the average average := sum div listlen; {Count the number of input values that are > average for counter := 1 to listlen do if (intlist[counter] > average) then result := result + 1; {Print result writeln('the number of values > average is ', result); end writeln('error-input list length is not legal') C (1971) was developed at Bell Labs as a systems programming language. It's characteristics come both from ALGOL and in-house developments. (Partially from Sebesta) /* C Example Program Input: An integer, listlen, where listlen is less than 100, followed by listlen-integer values Output: The number of input values that are greater than the average of all input values */ void main() { int intlist[99], listlen, counter, sum, average, result; sum = 0; result = 0; scanf("%d", &listlen); if ((listlen > 0) && (listlen < 100)) { /* Read input into an array and compute the sum */ for ( counter = 0; counter < listlen; counter++ ) {

scanf("%d", &intlist[counter]); sum += intlist[counter]; /* Compute the average */ average = sum / listlen; /* Count the input values that are > average */ for ( counter = 0; conter < listlen; counter++ ) if ( intlist[counter] > average) result++; /* Print result */ printf("number of values > average is: %d\n", result); printf("error-input list length is not legal\n"); MODULA-2 Like Pascal, MODULA-2 was designed by Niklaus Wirth (1977). Its power derived from the natural support of abstract data types low-level, system programming features. It gained a great deal of popularity especially as a teaching language. Prolog Prolog (Programming logic) s a "logic programming language" that was somewhat popular among artificial intelligence researchers and practitioners. Ada Ada (after Ada Lovelace, daughter of Lord Byron and the first computer programmer) is the result of a length design process that was complete in 1983. Ada was the standard Department of Defense language for many years; the standardization of the language and the control over compilers meeting the standard exactly forced it to be probably the most portable language ever developed. It traces its design from Pascal although it also has many of the characteristics of PL/1. (more in class lectures) --Ada Example Program -- Input: An integer, LIST_LEN, where LIST_LEN is less than 100, -- followed by LIST_LEN-integer values -- Output: The number of input values that are greater than -- the average of all input values with TEXT_IO; use TEXT_IO; procedure ADA_EX is package INT_IO is new INTERGER_IO(INTEGER); use INT_IO; type INT+LIST+TYPE is array (1..99) of INTEGER;

INT_LIST : INT_LIST_TYPE; LIST_LEN, SUM, AVERAGE, RESULT : INTEGER; RESULT := 0; SUM := 0; GET(LIST_LEN); if (LIST_LEN > 0) and (LIST_LEN < 100) then -- Read input data into an array and computer the sum for COUNTER := 1.. LIST_LEN loop GET(INT_LIST(COUNTER)); SUM := SUM + INT_LIST(COUNTER); end loop; -- Compute the average AVERAGE := SUM div LIST_LEN; -- Count the number of values that are > average -- for COUNTER := 1.. LIST_LEN loop if INT_LIST(COUNGER) > AVERAGE then RESULT := RESULT + 1; end if; end loop; -- Print result PUT("The number of values > average is : "); PUT(RESULT); NEW_LINE; PUT_LINE("Error-input list length is not legal"); end if; end ADA_EX; C++ C++ is an extension of C++ with many modern improvements plus a reasonably solid object-oriented implementation. Changes included parameter type checking, public and private access to class elements, constructors and destructors, inline functions, default parameters, operator overloading, parameter call by reference, and so forth. It was developed at Bell Labs by Bjarne Stroustrup. (1985) // Standard C++ Example Program // Input: An integer, listlen, where listlen is less than 100, //-- followed by listlen-integer values // Output: The number of input values that are greater than // the average of all input values int main() { int listlen; cin >> listlen; if ((listlen > 0) && (listlen < 100)) {

-- Read input into an array and compute the sum int sum = 0; for (int counter = 0; counter < listlen; counter++ ) { cin >> intlist[counter]; sum += intlist[counter]; -- Compute the average int average = sum / listlen; -- Count the input values that are > average int result = 0; for ( int counter = 0; conter < listlen; counter++ ) if ( intlist[counter] > average) result++; -- Print result cout << "Number of values > average is " << result << endl; cout << "Error-input list length is not legal" << endl; return 0; Java Java (Sun Microsystems, 1995) was designed to have similar functionality as C++ but smaller and safer with an entire object-oriented environment. (from Sebesta) // Java example program // Input: An integer, listlen, where listlen is less than 100, //-- followed by listlen-integer values // Output: The number of input values that are greater than // the average of all input values import java.io.*; class IntSort { public static void main(string args[]) throws IOException { DataInputStream in = new DataInputStream(System.in); int istlen, counter, sum = 0; average, result = 0; int[] intlist = int[99]; listlen = Integer.parseInt(in.readLine()); if ((listlen > 0) && (listlen < 100)) {

/* Read input into an array and sumputer the sum */ for ( counter = 0; counter < listlen; counter++ ) { intlist[counter] = Integer.valueOf(in.readLine()).intValue(); sum += intlist[counter]; /* Computer the average */ average = sum / listlen; /* Count the input values that are > average */ for ( counter = 0; counter < listlen; counter++ ) if (intlist[counter] > average) result++; /* Print result */ System.out.println( "\nnumber of values > average is: " + result ); System.out.println("Error-input list length is not legal \n"); Graphical Languages LabView EONReality