welcome to cs 335/535

34

Upload: brendan-powers

Post on 01-Jan-2016

60 views

Category:

Documents


0 download

DESCRIPTION

Welcome to CS 335/535. Programming Languages. Professor Dolores Zage. Computer Science Department [email protected] RB 443 (765) 285-8646 http://www.cs.bsu.edu/homepages/dmz/. Materials. Programming Languages Concepts and Constructs Ravi Sethi. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Welcome to CS 335/535
Page 2: Welcome to CS 335/535
Page 4: Welcome to CS 335/535

Materials Programming Languages Concepts and Constructs Ravi Sethi

Page 5: Welcome to CS 335/535

Course Overview and History of Programming Languages

Lecture 1:

Dolores Zage

Page 6: Welcome to CS 335/535

Programming Languages

Two types of courses Survey of PL Principles of PL

Page 7: Welcome to CS 335/535

“Survey of PL” Courses

A “survey” course aims to expose to student to a variety of specific programming languages.

Page 8: Welcome to CS 335/535

“Principles of PL” Courses

A “principles” course aims to teach the underlying concepts behind all programming languages

Page 9: Welcome to CS 335/535

This Course

is a “principles” course will use a variety of specific programming

languages to illustrate concepts. C++ Java Prolog Scheme ML ? Ada ?

Page 10: Welcome to CS 335/535

Goals of Course

After completing this course, a student should be able to learn new languages quickly evaluate appropriateness of a language for a

task

Page 11: Welcome to CS 335/535

Why do schools teach other natural languages? Create pain studying other languages makes you reference

“your own” obtain a deeper understanding and grasp expressiveness become a better speller notice that spoken languages are not enough to

communicate all thought -- the mathematical language

Page 12: Welcome to CS 335/535

languages

Natural communicate among

humans write essays few write well 300,000 years old extremely complex no formal theory is

capable of describing

Programming communicate with

literal-minded machine write programs few write well 50 years old complex based on mathematical

formalisms

Page 13: Welcome to CS 335/535

History of Programming Languages

50 years over 120 widely used languages The 50s - FORTRAN and LISP The 70s - Ada, C, Pascal, Prolog and

Smalltalk The 80s - C++ and ML The 90s - Java

Page 14: Welcome to CS 335/535

Frederick Brooks“… the programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so rapidly capable of realizing grand conceptual structures.”

We build new creations that have powerful effects on the real world.

Page 15: Welcome to CS 335/535

Types of Languages

Numerically Based Business Artificial Intelligence Systems

Page 16: Welcome to CS 335/535

Role of Programming Languages

Initially languages were designed to execute efficiently

Any high-level language had to be competitive with the execution behavior of hand-coded assembly

Portability became the issue Ease maintenance

Page 17: Welcome to CS 335/535

Other Influences

Computer capabilities Applications Programming methods Implementation methods Theoretical studies Standardization

Page 18: Welcome to CS 335/535

The subject of programming languages is at the exciting juncture of theory and practice-- where the mind meets the computer

Page 19: Welcome to CS 335/535

Early Applications

Early four basic domains: business, scientific, system and AI

Business - COBOL Scientific - FORTRAN System - Assembler AI -LISP

Page 20: Welcome to CS 335/535

Modern Applications

Business - COBOL, 4GLs, spreadsheet Scientific - FORTRAN, C, C++ AI - LISP, Prolog Publishing - TeX, Postscript Process - UNIX shell, TCL, PERL New Paradigms - ML, Eiffel, SDL

Page 21: Welcome to CS 335/535

Effects of Environments

Batch-processing interactive embedded-system programming

Page 22: Welcome to CS 335/535

Batch Processing

Files are usually the basis for most I/O Files are stored as fixed length records error terminates execution - acceptable but

costly no external help error and exception handling lack of timing constraints

Page 23: Welcome to CS 335/535

Interactive

Support for terminal interaction error handling - bad data from keyboard,

automatic feedback and correction from user, less need of language for handling errors

termination as a result of error is usually not acceptable (unlike batch)

has timing constraints (video game)

Page 24: Welcome to CS 335/535

Embedded System Often operate without usual environment of

files and I/O Nonstandard devices provide access to hardware - registers,

memory locations, interrupt handlers Error handling - extreme importance - Failure

may be life-threatening reliability and correctness real-time distributed - run indefinitely and concurrently

Page 25: Welcome to CS 335/535

Programming Environments

Features aiding separate compilation - redeclare shared information or prescribe an order of compilation or a library of specs

Features aiding testing and debugging - trace, breakpoints, assertions

Page 26: Welcome to CS 335/535

Environment Frameworks

Infrastructure services supplies data repository, graphical user

interface, security, communication services programs are written to use these services easily use services as part of their program

design good - gives common behavior pattern for

the user (Dr. Place’s Windows programming)

Page 27: Welcome to CS 335/535

Specific Languages - FORTRAN

First - developed by a team lead by John Bacus 1955-57

FORmula TRANslator numerical calculations extremely successful - FORTRAN II in 58,

FORTRAN IV (standardized in 66 and rename to FORTRAN 66), FORTRAN 77, FORTRAN 90

Page 28: Welcome to CS 335/535

ALGOL

Afraid of IBM domination Peter Naur lead ALGOrithmic Language where FORTRAN was optimized to run on

IBM 704, ALGOL was not bound to single computer architecture

goal was ambitious (did not really know how to do this)

Page 29: Welcome to CS 335/535

ALGOL

Lead to call by name concept no commercial success, however, many

important advances Jules Schwartz developed Jules’ Own

Version of IAL (the original name of ALGOL) JOVIAL-

JOVIAL was the standard for US Air Force applications

Page 30: Welcome to CS 335/535

ALGOL advances

Variables are changed block and procedures are basic units procedures may call themselves recursively data are organized into different types identifiers have lexical scope

Page 31: Welcome to CS 335/535

Other Advances

Bacus used a syntactic notation comparable to context free language developed by Chomsky (BNF)

Lukasiewicz - enable arithmetic expression to be written without () - efficient stack-based evaluation

basis of stack architecture - Burroughs based a computer and wrote a ALGOL compiler that ran faster than any FORTRAN

Page 32: Welcome to CS 335/535

Other Advances

Classes to ALGOL - Nygaard and Dahl who later developed Simual 67 gave Stroustrup the idea for C++ Wirth developed ALGOL-W then later

developed Pascal in early 70s PL/I - multipurpose programming language

intended for the IBM 360s

Page 33: Welcome to CS 335/535

C

Designed and implemented by Dennis Ritchie at Bell Laboratories in 1972

influenced by B developed by Ken Thompson for the first UNIX system on PDP-11

graphics and network programming require greater access to the hardware environment

1989 the ANSI standard established

Page 34: Welcome to CS 335/535

OO Languages

Smalltalk ( 1970s) C++ (late 70s) Ada (80s) - constructs for concurrent

execution and real time programming, construct for aggregating data structures and subprocedures called a package, and a mechanism for exception handling