Chapter 2: Evolution of the Major Programming Languages Lectures

Download Report

Transcript Chapter 2: Evolution of the Major Programming Languages Lectures

Chapter 2: Evolution of the Major
Programming Languages
Lectures # 5
Chapter 2: Evolution of the Major
Programming Languages










The IBM 704 and Fortran
Functional Programming: Lisp
The First Step Toward Sophistication: Algol 60
Computerizing Business Records: COBOL
The Beginnings of Timesharing: BASIC
Everything for Everybody: PL/I
Two Early Dynamic Languages: APL and SNOBOL
The Beginnings of Data Abstraction: SIMULA 67
Orthogonal Design: ALGOL 68
Some Early Descendants of the ALGOLs
Chapter 2: Evolution of the Major Programming Languages
2
Chapter 2: Evolution of the Major
Programming Languages

Programming Based on Logic: Prolog

History’s Largest Design Effort: Ada

Object-Oriented Programming: Smalltalk

Combining Imperative and Object-Oriented Programming: C++

An Imperative-Based Object-Oriented Language: Java

Scripting Languages for the Web

A C-Based Language for the New Millennium: C#

Markup/Programming Hybrid Languages
Chapter 2: Evolution of the Major Programming Languages
3
IBM 704 and Fortran



Fortran 0 : 1954 - not implemented
Fortran I : 1957
 Designed for IBM 704.
 First implemented and compiled high level language.
 Variable names could have up to six characters.
 I/O formatting.
 User-defined subprograms.
 IF selection statement.
 DO loop statement.
 No data typing statements.
Fortran II : 1958


Independent compilation of subprograms.
Fixed the bugs in Fortran I.
Chapter 2: Evolution of the Major Programming Languages
5
IBM 704 and Fortran (cont.)

Fortran IV : 1960-1962




Fortran 77




Explicit type declarations.
Logical IF selection statement.
Passing Subprograms as parameters to other subprograms.
Character string handling.
Logical loop control statement.
IF-THEN-ELSE statements.
Fortran 9X




Dynamic arrays and Pointers.
Recursion.
CASE statement.
Parameter type checking.
Chapter 2: Evolution of the Major Programming Languages
6
Functional Programming: LISP

LIST Processing language.

Needed by AI researchers 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.
Chapter 2: Evolution of the Major Programming Languages
7
Other Functional Programming



Scheme: Developed at MIT in mid 1970s.
 Small size.
 Extensive use of static scoping.
 Treatment of functions as first-class entities (functions
can be assigned to variables, passed as parameters, and
returned as values).
 Simple syntax make it ideal for educational applications.
COMMON LISP
 An effort to combine features of several dialects of LISP
into a single language.
 Large and complex language.
ML, Miranda, and Haskell are related languages.
Chapter 2: Evolution of the Major Programming Languages
8
The First Step Toward Sophistication:
Algol 60 (Algorithmic Language)


Algol 58: Added several new constructs to Fortran.
 Identifiers could be any length.
 Arrays could have any number of subscripts.
 Parameters were separated by mode (in & out).
 Compound statements (begin ... end).
Algol 60
 Two parameter passing methods.
 Subprogram recursion.
 Stack-dynamic arrays.
 First machine-independent language.
 First language whose syntax was formally defined (BNF).
Chapter 2: Evolution of the Major Programming Languages
9
Computerizing Business Records:
COBOL

Based on FLOW-MATIC features such as:

Names up to 12 characters, with embedded hyphens.

English names for arithmetic operators.

Data and code were completely separate.

Hierarchical data structures (records).

Nested selection statements.

Long names (up to 30 characters), with hyphens.

Separate data division.
Chapter 2: Evolution of the Major Programming Languages
10
The Beginnings of Timesharing:
BASIC

Based on Fortran with some influence from Algol 60.

Easy to learn and use for non-science students.

Pleasant and friendly.

Free and private access.

User time is more important than computer time.

Current: Visual BASIC.

First widely used language with time sharing.
Chapter 2: Evolution of the Major Programming Languages
11
Everything for Everybody: PL/I

Designed to be used in both business and scientific
applications.

First allowed to create concurrently executing subprograms,
but it was poorly developed in PL/I.

First exception handling.

Used recursion.

First pointers were included as a data type.
Chapter 2: Evolution of the Major Programming Languages
12
Two Early Dynamic Languages:
APL and SNOBOL

APL (A Programming Language)





Characterized by dynamic typing and dynamic storage allocation
Variables are untyped.
 A variable acquires a type when it is assigned a value.
Storage is allocated to a variable when it is assigned a value.
Highly expressive (many operators, for both scalars and arrays of
various dimensions).
SNOBOL



Designed as a string manipulation (text processing) language.
Powerful operators for string pattern matching.
Slower than alternative languages.
Chapter 2: Evolution of the Major Programming Languages
13
The Beginnings of Data Abstraction:
SIMULA 67



Designed primarily for system simulation.
Based on ALGOL 60 and SIMULA I.
New features:
 Coroutines - a kind of subprograms:




Subprograms are allowed to restart at the position where
they previously stopped.
Implemented in a structure called a class.
Classes are the basis for data abstraction.
Classes are structures that include both local data and
functions.
Chapter 2: Evolution of the Major Programming Languages
14
Orthogonal Design: ALGOL 68

Design is based on the concept of orthogonality:

A few principle concepts, few combining mechanisms.

Had strong influence on subsequent languages, such as Pascal,
C, Modula 2, Ada, C++, Java, and Perl.

New features:

User-defined data structures.

Reference types.

Dynamic arrays (called flex arrays).
Chapter 2: Evolution of the Major Programming Languages
15
Some Early Descendants of the
ALGOLs

Pascal - 1971
 Designed for teaching structured programming.
 Small, simple, nothing really new.
 Largest impact on teaching programming.


From mid-1970s until the late 1990s.
C – 1972
 Evolved primarily from BCLP, B, but also ALGOL 68.
 Powerful set of operators, but poor type checking.
 Initially spread through UNIX.
 Many areas of application.
Chapter 2: Evolution of the Major Programming Languages
16
Programming Based on Logic:
Prolog

Based on formal logic.

Non-procedural.

Can be summarized as being an intelligent database system
that uses an inference process to infer the truth of given
queries.

Highly inefficient, small application areas.
Chapter 2: Evolution of the Major Programming Languages
17
History’s Largest Design Effort:
Ada


New features:
 Packages - support for data abstraction.
 Exception handling  Generic program units.
 Concurrency - through the tasking model.
Ada 95 (began in 1988)




Support for OOP through type derivation.
Better control mechanisms for shared data.
New concurrency features.
More flexible libraries.
Chapter 2: Evolution of the Major Programming Languages
18
Object-Oriented Programming:
Smalltalk

First full implementation of an object-oriented language (data
abstraction, inheritance, and dynamic type binding).

Pioneered the graphical user interface design.

Promoted OOP.
Chapter 2: Evolution of the Major Programming Languages
19
Combining Imperative and ObjectOriented Programming: C++

Evolved from C and SIMULA 67.

Facilities for object-oriented programming, taken partially
from SIMULA 67.

Provides exception handling.

A large and complex language, in part because it supports
both procedural and OO programming.

Rapidly grew in popularity, along with OOP.

ANSI standard approved in November 1997.

Microsoft’s version (released with .NET in 2002).
Chapter 2: Evolution of the Major Programming Languages
20
Related OOP Languages


Eiffel (designed by Bertrand Meyer - 1992)

Not directly derived from any other language.

Smaller and simpler than C++, but still has most of the
power.

Lacked popularity of C++ because many C++ enthusiasts
were already C programmers.
Delphi (Borland)

Pascal plus features to support OOP.

More elegant and safer than C++.
Chapter 2: Evolution of the Major Programming Languages
21
An Imperative-Based ObjectOriented Language: Java

Based on C++

Significantly simplified (does not include struct,
union, enum, pointer).

Supports only OOP.

Has references, but not pointers.

Includes support for applets and a form of concurrency.
Chapter 2: Evolution of the Major Programming Languages
22
An Imperative-Based ObjectOriented Language: Java (cont.)

Java Evaluation:

Eliminated unsafe features of C++.

Concurrency features.

Libraries for applets, GUIs, database access.

Portable: Java Virtual Machine concept, JIT compilers.

Widely used for WWW pages.

Use for other areas increased faster than any other language.

Most recent version, 5.0, released in 2004.
Chapter 2: Evolution of the Major Programming Languages
23
Scripting Languages for the Web

JavaScript




PHP



A joint venture of Netscape and Sun Microsystems.
Used in Web programming (client side) to create dynamic
HTML documents.
Related to Java only through similar syntax.
PHP: Hypertext Preprocessor.
Used for Web applications (server side); produces HTML code
as output.
Python


An OO interpreted scripting language.
Type checked but dynamically typed.
Chapter 2: Evolution of the Major Programming Languages
24
A C-Based Language for the New
Millennium: C#

Part of the .NET development platform.

Based on C++ , Java, and Delphi.

Provides a language for component-based software
development.

All .NET languages (C#, Visual BASIC.NET, Managed
C++, J#.NET, and Jscript.NET) use Common Type System
(CTS), which provides a common class library.

Likely to become widely used.
Chapter 2: Evolution of the Major Programming Languages
25
Markup/Programming Hybrid
Languages

XSLT
 eXtensible Markup Language (XML): a metamarkup language.
 eXtensible Stylesheet Language Transformation (XSLT)
transforms XML documents to XHTML 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.
Chapter 2: Evolution of the Major Programming Languages
26