(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.

Slides:



Advertisements
Similar presentations
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Advertisements

Chapter 1: Preliminaries
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
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.
Programming Languages Structure
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
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.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Programming Language Concepts
1 Programming Languages Marjan Sirjani 2 1- The Study of Programming Languages The purpose of language is simply that it must convey meaning. (Confucius)
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Chapter 1 Preliminaries. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of Programming Languages.
Language Evaluation Criteria
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
COP4020 Programming Languages
Chapter 1. Introduction.
CS 363 Comparative Programming Languages
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
1 Programming Languages Marjan Sirjani Course web site:
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
ICS 313 Fundamentals of Programming Languages Instructor: Abdul Wahid Wali Lecturer, CSSE, UoH
ISBN Chapter 1 Preliminaries. Corrected and improved by Assoc. Prof. Zeki Bayram, EMU, North Cyprus. Original Copyright © 2007 Addison-Wesley.
Programming Languages Design Considerations (Qualities) Readability –Simplicity and Clarity –Orthogonality –Control Statements –Data Types and Structures.
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 © 2015 Pearson. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of Programming.
ISBN Chapter 1 Preliminaries. Copyright © 2009 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Programming Domains 1.Scientific Applications Typically, scientific applications have simple data structures but require large numbers of floating-point.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
Programming Language Design Issues Programming Languages – Principles and Practice by Kenneth C Louden.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
CSCE 343 – Programming Language Concepts Welcome!.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
The College of Saint Rose CIS 433 – Programming Languages David Goldschmidt, Ph.D. from Concepts of Programming Languages, 9th edition by Robert W. Sebesta,
Chapter 1. Introduction.
Why study programming languages?
CS 326 Programming Languages, Concepts and Implementation
PROGRAMMING LANGUAGES
Chapter 1 Reasons to study concepts of PLs Programming Domains
课程名 编译原理 Compiling Techniques
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
CS 3304 Comparative Languages Fall 2011
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Chapter 1 Preliminaries.
Programming Languages 2nd edition Tucker and Noonan
Chapter 1 Preliminaries.
Principles of Programming Languages
Chapter 1 Preliminaries.
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Chapter 1 Preliminaries.
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Presentation transcript:

(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson

(1.2) Coen Fundamentals  Overview of course – syllabus – assignments  Background survey – language experience – relevant courses  Motivation  Programming domains and language types  Evaluating programming languages  Influences on programming language design  Translation  Programming environments  Programming language history

(1.3) Why Study Programming Languages?  Increased capacity to express programming concepts  Better able to select a language to solve a problem  Better able to learn and use a new programming language  Better able to understand the impact of other features (e.g., architecture) on a language – and vice versa

(1.4) Why Study Programming Languages? (continued)  Greater understanding of significant implementation issues  Culture – programming languages have impact on almost everything about computing  Lots of opportunities to design small languages

(1.5) Programming Domains  Scientific applications – execution efficiency, numerical accuracy  Business applications – decimal data types, I/O editing, record structures  Artificial intelligence – symbol manipulation, programs as data  Systems programming – efficiency, access to hardware features  Very high-level languages – perl, tcl/tk, PowerBuilder  Special purpose languages – RPG, GPSS

(1.6) Basic Models of PL Design  Imperative – command driven, computer oriented – C, Pascal, Ada, etc. – OO (Smalltalk, C++, Java) as a subset  Functional – apply functions to arguments – process oriented – LISP  Declarative or relational – logical description of problem – specification, not process – Prolog

(1.7) Criteria for Evaluating PLs - Design Reflects Tradeoffs  Readability (understandability) – simplicity » too many features » > 1 feature for same purpose – orthogonality » small number of primitives which can be combined in a relatively small number of ways » learning and use easier » ALGOL 68, LISP – control statements » enough for expressibility, not too many

(1.8) Criteria for Evaluating PLs - Design Reflects Tradeoffs (continued)  Reliability (continued) – data types and structures » ditto – syntax » uniformity and expressiveness  Writeability – simplicity and orthogonality – abstraction mechanisms – expressibility

(1.9) Criteria for Evaluating PLs - Design Reflects Tradeoffs (continued)  Reliability – type checking – mechanisms to minimize aliasing – exception handling  Cost – learning – program development » compilation » execution – maintenance – portability

(1.10) Influences on PL Design  Computer architecture – vonNeumann architecture – parallel and network environments – PROLOG machines  Programming methodologies and paradigms – machine vs. human efficiency – shift from process to data orientation » data abstraction, object-oriented – concurrency

(1.11) Influences on PL Design (continued)  Trade-offs – reliability vs. cost of execution » bounds checking – writability vs. readability » APL – flexibility vs. safety » strong type checking (e.g., Ada)

(1.12) Fundamental Concepts for Describing PLs  Syntax – what is a grammatically correct construct  Semantics – what is the meaning of a PL statement  We separate these for discussion purposes, but they are closely related – the semantics should follow from the syntax – both are often intertwined in translators

(1.13) Kinds of Translators  Compilers – translate source code into machine code one time and the machine code executes  Interpreters – translate each source code statement every time it executes  Hybrid systems – translate the source code into a simpler form once, then interpret the translated form  Compilers provide code that executes rapidly, interpreters provide flexibility

(1.14) Compilation Process Source Program Lexical Analysis Syntax Analysis Intermediate Code Gen Code Generation Object Program Optimization lexical units parse trees int. text machine code Syntax Semantics Symbol Table

(1.15) Lexical Analysis  Breaks input stream into tokens – reserved words – keywords – identifiers – operators – punctuation

(1.16) Lexical Analysis (continued)  Information about tokens kept in symbol table – may contain » text string, type, location » block » number subscripts, upper/lower bounds – token is then represented as pointer to symbol table – syntax, semantics, code gen all use symbol table – requires easy insertion/deletion, rapid search

(1.17) Syntax Analysis  Generated from grammar describing PL  Verifies correct syntax, produces internal representation – build parse trees  Two basic approaches – bottom up » start with tokens, reduce to nonterminals, continue until find start symbol » LR(k) – top down » begin with start symbol, guess at production applied, continue until terminal string produced » LL(k)

(1.18) (Static) Semantic Analysis  Enters information in symbol table  Checks that symbol table information meets constraints of use – type compatibility, number of subscripts, number of parameters  Generate intermediate text – equivalent to assembly language – postfix, n-tuples, abstract parse trees  Associate semantic actions with productions in grammar – like attribute grammar

(1.19) Optimization and Code Generation  Optimization – can occur on intermediate text or generated code – analyzes » redundant operations » code movement out of loop » unreachable blocks – takes advantage of target architecture » parallelism, superscalar  Code Generation – depends on target machine architecture – find patterns in intermediate text, match with templates, produce corresponding machine code – can produce machine code, assembly, high- level language (preprocessor)

(1.20) Programming Environments  Editors  Debuggers  Version control systems  File systems  Test generators  Windows systems

(1.21) PL History  First wave – Fortran (1957) – Algol-60 ( ) – Cobol ( ) – LISP (1958)  Second wave – PL/I ( ) – Algol-68

(1.22) PL History (continued)  Third wave – Pascal ( ) – C (1972) – Prolog ( )  Fourth wave – Smalltalk ( ) – Ada ( ) – C++ (1985) – Ada 95 ( ) – Java (1995)