CS 363 Comparative Programming Languages

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
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
CS 354 Overview. Addison-Wesley –2 Course Topics What is a programming language? What features do programming languages have? How are these features.
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.
ISBN Chapter 1 Preliminaries. Copyright © 2007 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
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.
ISBN Chapter 1 Preliminaries. Copyright © 2007 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
INTRODUCTION "When the only tool you have is a hammer, everything looks like a nail" (Abraham Maslow)
Programming Language Concepts
Chapter 1 Preliminaries.
Chapter 1 Preliminaries. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of Programming Languages.
C H A P T E R O N E Overview.
ISBN Chapter 1 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved. 1-2 Chapter 1 Topics Reasons for Studying Concepts of.
CS 355 – Programming Languages
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
Chapter 1 Preliminaries CS Concepts of Programming Languages.
Programming Languages Summer
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.
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.
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.
ISBN Chapter 1 Preliminaries. 1-2 Chapter 1 Preliminaries 1.1 Reasons for Studying Concepts of Programming Languages 1.2 Programming Domains.
ISBN Structure of Programming Languages Prof. Dr. Mostafa Abdel Aziem Mostafa Senior Lecturer
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
ISBN Chapter 1 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Chapter 1 Preliminaries.
Concepts of Programming Languages
Why study programming languages?
Chapter 1 Preliminaries.
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.
Chapter 1 Preliminaries.
CS 3304 Comparative Languages Fall 2011
Chapter 1 Introduction.
Chapter 1 Preliminaries.
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Programming Languages 2nd edition Tucker and Noonan
Chapter 1 Preliminaries.
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.
Chapter 1 Preliminaries.
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Presentation transcript:

CS 363 Comparative Programming Languages Introduction

Chapter 1 Topics Motivation Language Paradigms Programming Domains Language Design and Evaluation Influences Tradeoffs Implementation options CS 363 GMU Spring 2005

Programming Languages Languages are an abstraction used by the programmer to express an idea interface to the underlying computer architecture Sebesta Fig. 1.2 CS 363 GMU Spring 2005

Why study Programming Languages? Increases ability to express ideas in a language wide variety of programming features Improves ability to choose appropriate language Each language has strengths and weaknesses in term of expressing ideas Improves ability to learn new languages different paradigms, different features What does the future of programming languages hold? Improves understanding of significance of implementation Provides ability to design new languages Domain specific languages increasingly popular CS 363 GMU Spring 2005

Language Paradigms Imperative Object-oriented Functional Central features are variables, assignment statements, and iteration Ex: C, Pascal, Fortran Object-oriented Encapsulate data objects with processing Inheritance and dynamic type binding Grew out of imperative languages Ex: C++, Java Functional Main means of making computations is by applying functions to given parameters Ex: LISP, Scheme, Haskell CS 363 GMU Spring 2005

Language Paradigms Logic Dataflow Event-Driven Concurrent Declarative  Rule-based – implicit control flow Ex: Prolog Dataflow Declarative  Model computation as information flow – implicit control flow Inherently parallel Event-Driven Continuous loop with handlers that respond to events generated in unpredictable order, such as mouse clicks Often an add-on feature Ex: Java Concurrent Multiple interacting processes Ex: Java, High Performance Fortran (HPF), Linda CS 363 GMU Spring 2005

Programming Domains Scientific applications Business applications One of the earliest uses of computers Large number of floating point computations Long running Imperative (Fortran, C) and Parallel (High Performance Fortran) Business applications Produce reports, use decimal numbers and characters Increasingly toward web-centric (Java, Perl, XML-based languages) Imperative (Cobol) and domain specific (SQL) Artificial intelligence Model human behavior and deduction Symbol manipulation Functional (Lisp) and Logical (Prolog) Systems programming Need efficiency because of continuous use Parallel and event driven Imperative (C) … CS 363 GMU Spring 2005

Language Design Principles of Design Influences on Design Evaluation of a design CS 363 GMU Spring 2005

Principles of Language Design Basic Vocabulary: Syntax – what constitutes a correctly written program Type Systems and Semantics – these allow us to provide a meaning to a syntatically correct program. Memory management – data mapping, static and dynamic memory, stack, heap, object lifetime, garbage collection Exception handling – how to deal with unexpected problems at runtime CS 363 GMU Spring 2005

Influences on Language Design Von Neumann architecture: Data and programs stored in same memory Memory is separate from CPU Instructions and data are piped from memory to CPU Basis for imperative languages Variables model memory cells Assignment statements model piping Iteration is efficient CS 363 GMU Spring 2005

Influences on Language Design Programming methodologies 1950s and early 1960s: Simple applications; worry about machine efficiency Late 1960s: People efficiency became important; readability, better control structures Structured programming Top-down design and step-wise refinement Late 1970s: Process-oriented to data-oriented data abstraction Middle 1980s: Object-oriented programming CS 363 GMU Spring 2005

Influences on Program Design Special Purpose (Domain Specific) Abstraction closer to problem domain Personal Preferences terse vs. verbose recursion vs. iteration user controlled vs. language controlled dynamic allocation CS 363 GMU Spring 2005

Language Evaluation Criteria Readability – most important! Overall simplicity Orthogonality – A relatively small set of primitive constructs that can be combined in a relatively small number of ways Makes the language easy to learn and read Meaning is context independent Every possible combination is legal Lack of orthogonality leads to exceptions to rules Control statements Defining data types and structures Syntax considerations: identifier forms, special words, meaning CS 363 GMU Spring 2005

Language Evaluation Criteria Writability Simplicity and orthogonality Support for abstraction Expressivity Reliability Conformance to specs. Type checking Exception handling Aliasing Readability and writability CS 363 GMU Spring 2005

Language Evaluation Criteria Cost Categories Training programmers to use language Writing programs Compiling programs Executing programs Language implementation system Maintaining programs (readability) Safety – prevention of unchecked errors Others: portability, generality, well-definedness CS 363 GMU Spring 2005

Language Implementation Options Compilers Interpreters Hybrid options CS 363 GMU Spring 2005

Compilers Computer Symbol Table Output Scanner (lexical analysis) Syntactic/semantic structure tokens Syntactic structure Scanner (lexical analysis) Parser (syntax analysis) Semantic Analysis (IC generator) Code Generator Source language Machine language Code Optimizer Input Data Computer Symbol Table Output CS 363 GMU Spring 2005

Interpreters Interpreter Source Output language Input Data CS 363 GMU Spring 2005

Compilation vs. Interpretation Translate HL code directly into machine Translation can be slow Resulting code is fast (typically optimized) Interpretation: Execute HL code directly No translation costs Execution can be slow CS 363 GMU Spring 2005

Hybrid Output Interpreter Symbol Table Scanner (lexical analysis) tokens Syntactic structure Scanner (lexical analysis) Parser (syntax analysis) Semantic Analysis (IC generator) Source language Input Data Intermediate Code Interpreter Symbol Table Output CS 363 GMU Spring 2005

What makes a language successful? Expressive Power Included features impact programmer use Ease of use for Novice Pascal, Basic, Logo Ease of Implementation Excellent Compilers Economics, Patronage, Legacy CS 363 GMU Spring 2005