isbn 0-321-33025-0 chapter 2 evolution of the major programming languages

21
ISBN 0-321-33025-0 Chapter 2 Evolution of the Major Programming Languages

Post on 22-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

ISBN 0-321-33025-0

Chapter 2

Evolution of the Major Programming Languages

Copyright © 2006 Addison-Wesley. All rights reserved. 1-2

In the beginning, there was Machine Code

• What was wrong with using machine code?– Poor readability– Poor modifiability– Expression coding was tedious– Machine deficiencies--no indexing or floating point

• High-level language development went through a number of stages– Try it and see what works – Theoretical approach– Software Engineering approach

Copyright © 2006 Addison-Wesley. All rights reserved. 1-3

Assembly Language

• Replaces op-codes of machine language with mnemonics

• One-to-one mapping from machine language to assembly code

• Two approaches– CISC = complex instruction set computer

• 808x assembly language

– RISC = reduced instruction set computer• MIPS

Copyright © 2006 Addison-Wesley. All rights reserved. 1-4

Beyond Machine Code

• Pseudocodes were early attempts at high-level languages– Short Code– Speedcoding– UNIVAC compiling system

• These added operations that weren't built into the hardware

Copyright © 2006 Addison-Wesley. All rights reserved. 1-5

Fortran = FORmula TRANslator

• Fortran was the first high-level programming language

• Environment of development– Applications were scientific– No programming methodology or tools– Machine efficiency was most important

• Design choices– No need for dynamic storage– Need good array handling and counting loops– No string handling, decimal arithmetic, or

powerful input/output (commercial stuff)

Copyright © 2006 Addison-Wesley. All rights reserved. 1-6

Functional Programming: LISP

• LISt Processing language– Designed at MIT by McCarthy

• AI research needed a language to– Process data in lists (rather than arrays)– Symbolic computation (rather than numeric)

• Only two data types: atoms and lists• Syntax is based on lambda calculus

Copyright © 2006 Addison-Wesley. All rights reserved. 1-7

Scheme

• Developed at MIT in mid 1970s• Small• Extensive use of static scoping• Functions as first-class entities• Simple syntax (and small size) make it

ideal for educational applications

Copyright © 2006 Addison-Wesley. All rights reserved. 1-8

Other Functional Languages

Copyright © 2006 Addison-Wesley. All rights reserved. 1-9

The First Step Toward Sophistication: ALGOL 60

• ALGOL 60 was the result of efforts to design a universal language

• Goals of the language– Close to mathematical notation– Good for describing algorithms– Must be translatable to machine code

Copyright © 2006 Addison-Wesley. All rights reserved. 1-10

ALGOL 58

• Concept of type was formalized• Names could be any length• Arrays could have any number of subscripts• Parameters were separated by mode (in &

out)• Subscripts were placed in brackets• Compound statements (begin ... end)• Semicolon as a statement separator• Assignment operator was :=• if had an else-if clause• No I/O - “would make it machine dependent”

Copyright © 2006 Addison-Wesley. All rights reserved. 1-11

ALGOL 60 Overview

• New features– Block structure (local scope)– Two parameter passing methods– Subprogram recursion– Stack-dynamic arrays– Still no I/O and no string handling

– Formal syntax description

Copyright © 2006 Addison-Wesley. All rights reserved. 1-12

Computerizing Business Records: COBOL

• Environment of development– A number of different business languages were

being developed by various organizations

• Design goals– Must look like simple English– Must be easy to use, even if that means it will be

less powerful– Must broaden the base of computer users– Must not be biased by current compiler problems

• Still the most widely used business applications language

Copyright © 2006 Addison-Wesley. All rights reserved. 1-13

The Beginning of Timesharing: BASIC

• Designed by Kemeny & Kurtz at Dartmouth• Design Goals:

– Easy to learn and use for non-science students– Must be “pleasant and friendly”– Fast turnaround for homework– Free and private access– User time is more important than computer time

• Never standardized - many versions over the years

• First widely used language with time sharing

Copyright © 2006 Addison-Wesley. All rights reserved. 1-14

Some other milestones

• PL/1 - an attempt to write one language that everyone could use

• Dynamic typing– APL - lots of operators for vector and matrix

operations– SNOBOL - designed for string processing

• Data abstraction (eventually resulted in Object-Oriented programming)– SIMULA 67

Copyright © 2006 Addison-Wesley. All rights reserved. 1-15

Early Descendants of ALGOLs

• ALGOL languages impacted all imperative languages– Pascal - a teaching language that didn't stay in

school– C - designed for system applications– Modula/Modula 2– Ada - language designed by committee– Oberon– C++/Java– Perl (to some extent)

Copyright © 2006 Addison-Wesley. All rights reserved. 1-16

Programming Based on Logic: Prolog• Developed, by Comerauer and Roussel

(University of Aix-Marseille), with help from Kowalski ( University of Edinburgh)

• Based on formal logic• Non-procedural• Can be summarized as being an

intelligent database system that uses an inferencing process to infer the truth of given queries

• Highly inefficient, small application areas

Copyright © 2006 Addison-Wesley. All rights reserved. 1-17

Object-Oriented Programming

• Simula 67• Smalltalk

– First full implementation of an object-oriented language (data abstraction, inheritance, and dynamic type binding)

• C++ – Combines Imperative and Object-Oriented Programming

• Eiffel• Delphi (Borland)

– Based on Pascal

• Java• C#

– part of .NET programming environment

Copyright © 2006 Addison-Wesley. All rights reserved. 1-18

Scripting Languages

• General Scripting Languages– sh and other Unix shell

languages– awk– tcl/tk– perl– ruby– python

• An OO interpreted scripting language

• Scripting Languages for the Web– JavaScript

• client side programming

• interpreted by browser

– PHP• server side web

applications• produces HTML code

as output

•Interpreted–A script (file) contains instructions to be executed

Copyright © 2006 Addison-Wesley. All rights reserved. 1-19

Markup/Programming Hybrid Languages

• XML, XSLT– eXtensible Markup Language (XML): a metamarkup

language– eXtensible Stylesheet Language Transformation (XSTL)

transforms XML documents for display– Programming constructs (e.g., looping)

• JSP– Java Server Pages: a collection of technologies to support

dynamic Web documents– servlet: a Java program that resides on a Web server;

servlet’s output is displayed by the browser

• ASP– .NET technologies for web documents

Copyright © 2006 Addison-Wesley. All rights reserved. 1-20

Genealogy of Common Languages

Copyright © 2006 Addison-Wesley. All rights reserved. 1-21

Further Reading

• Check out some of the Bibliographic Notes at the end of the chapter

• Most programming languages texts contain a brief history of programming languages

• Peter Wegner "Programming Languages - The First 25 Years" in IEEE Transactions on Computers, volume C-25, December 1976

• ACM History of Programming Languages Conference Proceedings, SIGPLAN Notices, volume 28, March 1993