CS 403 Programming Language Theory Class 2 - August 29, 2000.

Slides:



Advertisements
Similar presentations
Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
Advertisements

Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Chapter 1: Preliminaries
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
Reasons to study concepts of PL
ISBN Chapter 1 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Motivation Programming Domains.
CS 354 Overview. Copyright © 2007 Addison-Wesley. All rights reserved. 1–2 Course Topics What is a programming language? What features do programming.
A Quick Overview of Languages. FORTRAN Designed in 1955 First release of the compiler in 1957 Algebraic in nature Scientific (numeric not string oriented)
1 Copyright © 1995 by Addison-Wesley Publishing Co. 1. Plankalkül Never implemented - Advanced data structures - floating point, arrays, records.
Programming Languages Structure
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
ISBN Chapter 2 Evolution of the Major Programming Languages.
ISBN Chapter 2 Evolution of the Major Programming Languages.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
ISBN Chapter 1 Topics Motivation Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language.
ISBN Chapter 2 Evolution of the Major Programming Languages.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
Programming Language Concepts
Chapter 1 Preliminaries. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of Programming Languages.
1 Programming Language Concepts Ethics Why study concepts of programming languages (PLs)? PL categories Influences on PL design Problem areas & needs that.
CS 355 – Programming Languages
High-Level Programming Languages: C++
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
CS 363 Comparative Programming Languages
ISBN Chapter 2 Evolution of the Major Programming Languages.
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
1 Programming Language History and Evolution In Text: Chapter 2.
ISBN Chapter 2 Evolution of the Major Programming Languages.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
ISBN Chapter 2 Evolution of the Major Programming Languages.
ISBN CS 354 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Course Topics What is a programming language? What features.
ISBN Chapter 1 Preliminaries. Copyright © 2009 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
ISBN Structure of Programming Languages Prof. Dr. Mostafa Abdel Aziem Mostafa Senior Lecturer
1 Chapter 2 © 1998 by Addison Wesley Longman, Inc. 2.1 Plankalkül Never implemented - Advanced data structures - floating point, arrays, records.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Evolution of the Major Programming Languages Chapter 2: Evolution of the Major Programming Languages Lectures # 5.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
Programming Language History and Evolution
A BRIEF HISTORY OF PROGRAMMING LANGUAGES
Zuse’s Plankalkül – 1945 Never implemented Problems Zuse Solved
Concepts of Programming Languages
Chapter 1 Preliminaries.
Concepts of Programming Languages
CSCI 3370: Principles of Programming Languages Introduction
Chapter 1 Preliminaries.
PROGRAMMING LANGUAGES
Chapter 1 Reasons to study concepts of PLs Programming Domains
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Programming Language History and Evolution
Chapter 1 Preliminaries.
CS 3304 Comparative Languages Fall 2011
Chapter 1 Introduction.
Chapter 2 Plankalkül – Never implemented
Chapter 1 Preliminaries.
CS 3304 Comparative Languages Fall 2011
Chapter 1 Preliminaries.
Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
2.1 Plankalkül Pseudocodes Never implemented
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Chapter 1 Preliminaries.
Programming Languages
Chapter 1 Preliminaries.
Presentation transcript:

CS 403 Programming Language Theory Class 2 - August 29, 2000

Syllabus Texts: Sebesta: most of the content & theory  Everybody has a copy? Meyers: specific applications to C++ CD  Bookstore is getting the CD in…

Homework Assignment List all the languages you have easy access to now. Engineering labs Bama Your home PC, if relevant Other computers… Be sure to note the different implementations of each language. Due today. Turn it in now. Outside write: Name, Section 1 or 2

Homework Assignment #2 (1) Consider this program: #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) 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 5 th

Reading Quiz Name one language in chapter 2 you hadn’t heard of before, and one characteristic of that language. After you’ve written your answer, draw a line & confer with your table-mates. Correct your answer if necessary. We won’t take this up today. (I’ve already got enough to grade!)

Primary Influences on Language Design Computer architecture Programming methodologies

Computer Architecture We use imperative languages, at least in part, because we use von Neumann machines. Other architectures influence other languages, i.e., LISP machines, …

Programming Methodologies 1950s and early 1960s: Simple applications; worry about machine efficiency Late 1960s: People efficiency became important; readability, better control structures Late 1970s: Data abstraction Middle 1980s: Object-oriented programming

Language Categories 1.Imperative 2.Functional 3.Logic 4.Object-oriented (closely related to imperative)

Language Design Trade-Offs 1.Reliability versus cost of execution 2.Writability versus readability 3.Flexibility versus safety

Implementation Methods 1.Compilation Translate high-level program to machine code Slow translation Fast execution 2.Pure interpretation No translation Slow execution Becoming rare 3.Hybrid implementation systems Small translation cost Medium execution speed

Programming Environments The collection of tools used in software development 1. UNIX – An old operating system and tool collection 2. Borland C++ – A PC environment for C and C++ 3.Smalltalk –A language processor/ environment 4.Microsoft Visual C++ – A large, complex visual environment

Chapter 2: Evolution of Programming Languages (1) Plankalkül Pseudocodes Laning and Zierler System FORTRAN: I ; II ; IV ; ;

Language Evolution(2) LISP ALGOL ; COBOL BASIC PL/I

Language Evolution (3): Early Dynamic Languages SIMULA ALGOL Pascal C Prolog Ada Smalltalk C Java

Plankalkül Never implemented Advanced data structures floating point, arrays, records Invariants Notation: A(7) := 5 * B(6) | 5 * B => A V | 6 7 (subscripts) S | 1.n 1.n (data types)

Pseudocodes Before pseudocodes  machine codes What’s wrong with machine code? Poor readability Poor modifiability Expressions are tedious Machine weaknesses: no indexing, floating point,...

Pseudocodes: Short Code ‘49 Expressions were coded, left to right Speedcoding ‘54 Two weeks of programming  few hours! Automatically increment the instruction counter

FORTRAN New IBM 704 Index registers Floating point in hardware Environment of development: 1. Computers were small and unreliable 2. Applications were scientific 3. No programming methodology or tools 4. Machine efficiency was most important

FORTRAN 0 / I Impact of environment on design: 1. No need for dynamic storage 2. Need good array handling and counting loops 3. No string handling, decimal arithmetic, or powerful input/output (commercial stuff)

FORTRAN I First implemented version of FORTRAN Names could have up to six characters Posttest counting loop ( DO ) Formatted I/O User-defined subprograms Three-way selection statement (arithmetic IF ) No data typing statements

FORTRAN I Features (cont.) No separate compilation Compiler released in April 1957, after 18 worker/years of effort. Programs larger than 400 lines rarely compiled correctly, mainly due to poor reliability of the 704 hardware. Code was very fast Quickly became widely used

FORTRAN II Independent compilation Fix the bugs

FORTRAN IV Explicit type declarations Logical selection statement Subprogram names could be parameters ANSI standard in 1966

FORTRAN Character string handling Logical loop control statement IF-THEN-ELSE statement

FORTRAN 90 (“9X”) Modules Dynamic arrays Pointers Recursion CASE statement Parameter type checking

FORTRAN Evaluation: Dramatically changed forever the way computers are used!

LISP LISt Processing language (MIT, McCarthy) AI research needed a language that:  Process data in lists (vs. arrays)  Symbolic computation (vs. numeric) Only two data types: atoms and lists Syntax is based on lambda calculus

LISP (2) Pioneered functional programming No need for variables or assignment Control via recursion and conditional expressions Still the dominant language for AI COMMON LISP and Scheme are contemporary dialects of LISP ML, Miranda, and Haskell are related languages

ALGOL Environment of development:  FORTRAN had (barely) arrived for IBM 70X  Many other languages were being developed, all for specific machines  No portable language; all were machine-dependent  No universal language for communicating algorithms

ALGOL 58 (2) ACM and GAMM met for four days for design Goals of the language:  Close to mathematical notation  Good for describing algorithms  Must be translatable to machine code

ALGOL 58 (3) Language Features: Concept of type was formalized Names could have 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

ALGOL Modified ALGOL 58 at 6-day meeting in Paris New Features: Block structure (local scope) Two parameter passing methods Subprogram recursion Stack-dynamic arrays Still no i/o and no string handling

ALGOL 60 (2) Successes: It was the standard way to publish algorithms for over 20 years All subsequent imperative languages are based on it First machine-independent language First language whose syntax was formally defined (BNF)

ALGOL 60 (3) Never widely used, especially in U.S. Reasons:  No I/O and the character set made programs nonportable  Too flexible--hard to implement  Entrenchment of FORTRAN  Formal syntax description  Lack of support of IBM