cs 403
Download
Skip this Video
Download Presentation
CS 403

Loading in 2 Seconds...

play fullscreen
1 / 35

CS 403 - PowerPoint PPT Presentation


  • 52 Views
  • Uploaded on

CS 403. Programming Language Theory Class 3 - August 31, 2000. Homework Assignment #2 (1). Consider this program (on web page): #include <stdio.h> main() { int i; printf(“Value of i: \%d, \%o, \%x, \%u, \%c, \%f, \%ld ", i,i,i,i,i,i,i); i = 42;

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CS 403' - osbourne-olsen


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
cs 403

CS 403

Programming Language Theory

Class 3 - August 31, 2000

homework assignment 2 1
Homework Assignment #2 (1)
  • Consider this program (on web page):

#include

main() {

int i;

printf(“Value of i: %d, %o, %x, %u, \n %c, %f, %ld\n", i,i,i,i,i,i,i);

i = 42;

printf(“Value of i: %d, %o, %x, %u, \n %c, %f, %ld\n", i,i,i,i,i,i,i);

}

homework assignment 2 2
Homework Assignment #2 (2)
  • Compile and run (on 4 C compilers, including cc and gcc on UNIX)…
  • Print your program and the executions, identified by compiler.
  • Explain the output (about 1-2 pages)
    • What does ‘printf’ do, and what do the ‘%’ commands do?
    • Why the different but consistent output values for the same variable?
    • What differences do you note across compilers?
  • Turn in Tuesday, Sept 5th
slide4
UNIX
  • Seebeck web site has UNIX help
    • http://bama.ua.edu/~unixinfo/
    • Software on Bama… (important page!)
    • Learning Links…
  • Changing the type of your account:
    • “Web helpers”  “Changing your Bama shell” to “ksh”
  • Editors:
    • “vi” and “emacs”
using unix
Using UNIX
  • Make sure you have an interactive shell, not the ‘remote’ or ‘ftp-only’ (see web page to change it).
  • Get a ‘telnet’ software package (Seebeck Software page…). Install it.
  • Connect to Bama using telnet.
  • Edit your file on the PC, then ‘ftp’ it to Bama.
  • Compile it using ‘cc’ and ‘gcc’. Run each, & save the output screen.
chapter 2
Chapter 2
  • History of the Evolution of Programming Languages
  • For each language:
    • Notice the environment/ background that motivated the new language.
    • Note the major advances, and keep them in rough chronological sequence.
why review ancient history
Why Review AncientHistory?
  • All knowledge has a past, a present, and a future.
  • What we ‘knew’ last year has changed.
  • What we ‘know’ now will change…
  • What we learn tomorrow will not be permanent.
  • If you don’t know the past, you can’t understand the present.
cobol 1960
COBOL - 1960
  • Environment of development:
  • UNIVAC was beginning to use FLOW-MATIC
  • USAF was beginning to use AIMACO
  • IBM was developing COMTRAN
cobol 2
COBOL (2)
  • Based on FLOW-MATIC
  • FLOW-MATIC features:
    • Names up to 12 characters, with embedded hyphens
    • English names for arithmetic operators
    • Data and code were completely separate
    • Verbs were first word in every statement
cobol 3
COBOL (3)
  • First Design Meeting - May 1959
  • 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
cobol 4
COBOL (4)
  • Design committee were all from computer manufacturers and DoD branches
  • Design Problems:
    • arithmetic expressions?
    • subscripts?
    • Fights among manufacturers
cobol 5
COBOL (5)
  • Contributions:
  • First macro facility in a high-level language
  • Hierarchical data structures (records)
  • Nested selection statements
  • Long names (up to 30 characters), with hyphens
  • Data Division
cobol 6
COBOL (6)
  • Comments:
  • First language required by DoD; would have failed without DoD
  • Still the most widely used business applications language
basic 1964
BASIC - 1964
  • 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
pl i 1965
PL/I - 1965
  • Designed by IBM and SHARE
  • Computing situation in 1964 (from IBM's point of view)

1. Scientific computing

    • IBM 1620 and 7090 computers
    • FORTRAN
    • SHARE user group

2. Business computing

    • IBM 1401, 7080 computers
    • COBOL
    • GUIDE user group
pl i rationale
PL/I Rationale:
  • By 1963, however,
  • Scientific users began to need more elaborate I/O, like COBOL had; Business users began to need floating point and arrays (MIS)
  • It looked like many shops would begin to need two kinds of computers, languages, and support staff --> too costly!
pl i rationale1
PL/I Rationale
  • The obvious solution:
  • Build a new computer to do both kinds of applications
  • Design a new language to do both kinds of applications
pl i contributions
PL/I Contributions
  • First unit-level concurrency
  • First exception handling
  • Switch-selectable recursion
  • First pointer data type
  • First array cross sections
pl i comments
PL/I Comments
  • Many new features were poorly designed
  • Too large and too complex
  • Was (and still is) actually used for both scientific and business applications
early dynamic languages
Early Dynamic Languages
  • Characterized by dynamic typing and dynamic storage allocation
  • APL (AProgramming Language) 1962
    • Designed as a hardware description language (at IBM by Ken Iverson)
    • Highly expressive (many operators, for both scalars and arrays of various dimensions)
    • Programs are very difficult to read
  • SNOBOL(1964)
    • Designed as a string manipulation language
    • Powerful operators for string pattern matching
simula 67 1967
SIMULA 67 - 1967
  • Designed primarily for system simulation (by Nygaard and Dahl in Norway)
  • Based on ALGOL 60 and SIMULA I
  • Primary Contribution:
    • Coroutines - a kind of subprogram
    • Implemented in a structure called a class
    • Classes are the basis for data abstraction
    • Classes are structures that include both local data and functionality
algol 68 1968
ALGOL 68 - 1968
  • From the continued development of ALGOL 60, but it is not a superset of that language
  • Design is based on the concept of orthogonality
  • Contributions:
    • User-defined data structures
    • Reference types
    • Dynamic arrays (called flex arrays)
algol 68 comments
ALGOL 68 - Comments
  • Had even less usage than ALGOL 60
  • Had strong influence on later languages: Pascal, C, & Ada
pascal 1971
Pascal - 1971
  • Designed by Wirth, who quit the ALGOL 68 committee (didn't like the direction of that work)
  • Designed for teaching structured programming
  • Small, simple, nothing really new
  • Still the most widely used language for teaching programming in colleges (but use is shrinking)
c 1972
C - 1972
  • Designed for systems programming (at Bell Labs by Dennis Richie)
  • Evolved primarily from B, but also ALGOL 68
  • Powerful set of operators, but poor type checking
  • Initially spread through UNIX
other descendants of algol
Other descendants of ALGOL
  • Modula-2 & Modula-3 (by Wirth)
  • Oberon (by Wirth in late 1980s)
  • Delphi (Borland)
prolog 1972
Prolog - 1972
  • Developed at the University of Aix-Marseille, by Comerauer and Roussel, with some help ...
  • 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
ada 1983
Ada - 1983
  • Huge design effort, involving hundreds of people, much money, and about eight years (began in mid-1970s)
ada 2
Ada (2)
  • Contributions:
  • Packages - support for data abstraction
  • Exception handling - elaborate
  • Generic program units
  • Concurrency - through the tasking model
ada comments
Ada - Comments
  • Competitive design
  • Included all that was then known about software engineering and language design
  • First compilers were very difficult; the first really usable compiler came nearly five years after the language design was completed
ada 95 began in 88
Ada 95 (began in 88)
  • Support for OOP through type derivation
  • Better control mechanisms for shared data (new concurrency features)
  • More flexible libraries
smalltalk 1972 1980
Smalltalk - 1972-1980
  • Developed at Xerox PARC, initially by Alan Kay, later by Adele Goldberg
  • First full implementation of an object-oriented language (data abstraction, inheritance, and dynamic type binding)
  • Pioneered the graphical user interface everyone now uses
c 1985
C++ - 1985
  • Developed at Bell Labs by Stroustrup
  • Evolved from C and SIMULA 67
  • Facilities for object-oriented programming, taken partially from SIMULA 67, were added to C
  • Also has exception handling
slide34
C++ (2)
  • 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
java 1995
Java - 1995
  • Developed at Sun in the early 1990s
  • Based on C++
    • Significantly simplified
    • Supports only OOP
    • Has references, but not pointers
    • Includes support for applets and a form of concurrency
ad