The College of Saint Rose CIS 433 – Programming Languages David Goldschmidt, Ph.D. from Concepts of Programming Languages, 9th edition by Robert W. Sebesta,

Slides:



Advertisements
Similar presentations
Chapter 1: Preliminaries
Advertisements

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.
ISBN Chapter 1 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Programming Languages Structure
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
Lecture 2 Concepts of Programming Languages
ISBN Chapter 1 Topics Motivation Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 INTRODUCTION "When the only tool you have is a hammer, everything looks like a nail" (Abraham.
ISBN Chapter 1 Preliminaries. Copyright © 2007 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
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 363 Comparative Programming Languages
Chapter 1 Preliminaries CS Concepts of Programming Languages.
Hudson Valley Community College CISS-110 – Programming & Logic I David Goldschmidt, Ph.D.
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
ISBN Chapter 1 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Concepts of Programming Languages
Chapter 1 Preliminaries.
Why study programming languages?
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
PROGRAMMING LANGUAGES
Computer programming {weeks 01 and 02}
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Introduction.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Lecture 2 Concepts of Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
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.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Lecture 2 Concepts of Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Presentation transcript:

The College of Saint Rose CIS 433 – Programming Languages David Goldschmidt, Ph.D. from Concepts of Programming Languages, 9th edition by Robert W. Sebesta, Addison-Wesley, 2010, ISBN

 Why study programming languages?  Required course...  Diverse set of tools in your programming toolbox  Increased capacity to express ideas  Increased ability to build efficient and easy-to-maintain software systems  Why so many languages?

 Languages are not entirely general-purpose  Business applications (typically distributed) ▪ Process data, output reports, control transactions ▪ Increasingly distributed  Manufacturing and control systems ▪ Reliability and non-stop operation  Entertainment and Web applications ▪ Wide variety of online and device requirements ▪ Portability

 Languages are not entirely general-purpose  Scientific applications ▪ Often computationally intensive  Artificial intelligence and research applications ▪ Represent and manipulate symbols instead of numbers ▪ Also often computationally intensive  Systems and network programming ▪ Operating system and support programs ▪ Requires efficient non-stop operations

 How can we evaluate a programming language?  Goals of the language  Readability  Writability  Portability  Reliability (of the language—e.g. C++ vs. Java)  Cost ($$$, training costs, compilation process)  Ease of maintenance (of compilers and source code)

 Readability vs. writability  Perl is flexible and expressive—very writable  As a result, Perl is sometimes hard to read...  Writability vs. reliability  C and C++ both provide flexible use of pointers  As a result, C and C++ can be unreliably used ▪ Thus producing core dumps, null pointer references

 Imperative Languages  Data and programs are both stored in memory  Variables mimic memory  Assignment statements  Arithmetic operations  Iterative repetition  Control structures  etc.

 1940s – von Neumann architecture  1950s – simple applications (hardware focus)  1960s/1970s – structured programming  Costs shifted from hardware to software  Complexity and size of software grew dramatically  1970s/1980s – data-oriented program design  1980s – object-oriented program design  Data abstraction + Inheritance + Polymorphism  1990s/2000s – network/Web applications  2010s – mobile applications

 Imperative languages:  Evolved from the von Neumann architecture  Focus on variables, assignment and arithmetic statements, control structures, and iterative constructs  e.g. C, C++, Pascal, C#, Java, Perl, JavaScript, etc.

 Functional languages:  Apply (often recursive) functions to parameters  Usually an interpretive language  e.g. LISP, Scheme  Logic languages:  Rule-based approach to build a knowledge base  Perform queries against knowledge base  e.g. Prolog (also the Semantic Web)

 Object-oriented languages:  Evolved out of imperative languages  Data abstraction, inheritance, polymorphism, late binding  e.g. C++, Java, C#, Smalltalk, Eiffel  Markup and Web languages:  Web-based or application-specific markup languages specify layout of Web pages, database schemas, etc.  e.g. XHTML, XML, XSLT, MathML, RDF, etc.

 Low-level languages LDA #47 STA $570 DEX JSR $817 CPX #0 BNE #14 assembly code machine code (executable) translation program (assembler)

#include int main() { float x; cout << "... C++ source code intermediate code (object code) translation program (compiler) machine code (executable) linker program intermediate code of precompiled libraries ( object code)

public static void main( String[] args ) { float x; System.out. println( "... Java source code 7A F FE F D 4E intermediate code (byte code) translation program (compiler) virtual machine (JVM) A F AB AE F DA 44 intermediate code of precompiled libraries (java.util.Scanner byte code) program execution

lexical analysis groups characters into lexical units syntax analysis transforms lexical units into parse trees a parse tree represents the syntactic structure of the program analyzes parse trees to produce intermediate code transforms intermediate code into executable machine code

source code is both interpreted and executed via an interpreter REM COMMENT LET X = 5 LET Y = 8 PRINT X PRINT Y LET Z = X PRINT Z INPUT A$ BASIC source code

lexical analysis groups characters into lexical units syntax analysis transforms lexical units into parse trees analyzes parse trees to produce intermediate code intermediate code executed via a virtual machine

 A preprocessor transforms source code into preprocessed source code Source program Preprocessor Preprocessed source program #include #define PI #define E #ifdef DEBUG_MODE #endif C source code

 Read and study Chapters 1 and 2  Do Exercises at the end of Chapter 1  Categorize every programming language as compiled, interpreted, hybrid, etc.