Programming Languages and Design Lecture 1 Introduction to Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern University,

Slides:



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

Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Compiler Construction by Muhammad Bilal Zafar (AP)
CSI 3125, Preliminaries, page 1 Programming languages and the process of programming –Programming means more than coding. –Why study programming languages?
Chapter 1: Preliminaries
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
The Analytical Engine Module 6 Program Translation.
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.
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
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Language Evaluation Criteria
Overview. Copyright © 2006 The McGraw-Hill Companies, Inc. Chapter 1 Overview A good programming language is a conceptual universe for thinking about.
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
CS 355 – Programming Languages
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
COP4020 Programming Languages
Chapter 1. Introduction.
CS 363 Comparative Programming Languages
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
1 Programming Languages Tevfik Koşar Lecture - II January 19 th, 2006.
Programming Languages Summer
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
1 Programming Language History and Evolution In Text: Chapter 2.
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.
INF 212 ANALYSIS OF PROG. LANGS LECTURE 1 Instructors: Crista Lopes Copyright © Instructors.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Programming Languages
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
CSI 3125, Preliminaries, page 1 Preliminaries Programming languages and the process of programming. Criteria for the design and evaluation of programming.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
COP4020 Programming Languages Introduction Prof. Robert van Engelen (modified by Prof. Em. Chris Lacher)
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
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.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Programming Languages 2nd edition Tucker and Noonan
Why study programming languages?
PROGRAMMING LANGUAGES
课程名 编译原理 Compiling Techniques
1.1 Reasons to study concepts of PLs
Programming Languages
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Programming Languages 2nd edition Tucker and Noonan
Principles of Programming Languages
Programming Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
School of Computer & Information Engineering,
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Presentation transcript:

Programming Languages and Design Lecture 1 Introduction to Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern University, Houston January, 2008

2 Structure of the Lectures Review of the last lecture Summary of what will be covered Main contents Summary of what was covered Suggestions for the lecture

3 Homework Goals  Learn programming techniques  Reinforce the lecture material  Evaluate your comprehension Exercises and Problems  Understand concepts and put them in practice A good preparation for the exams!

4 Some Course Goals Programming Language Concepts  Learn useful concepts and programming methods  Understand the languages you use, by comparison  Appreciate history, diversity of ideas in programming  Be prepared for new programming methods, paradigms, tools Language design and implementation trade-off  Every convenience has its cost Recognize the cost of presenting an abstract view of machine Understand trade-offs in programming language design

5 Computer and Programming The Computer Age did not really begin until the first computer was made available to the public in 1951 (Seyed. H. Roosta) Modern computers are highly complex system  Hardware  Operating System  Middleware  Application layers Programming a computer is primarily designing and using abstractions to achieve new goals  Enormous number of abstractions work together in a highly organized manner

6 Abstractions Eliminate detail unnecessary for solving a particular problem  Complexity is hidden Open build upon one another  Allow us to solve increasingly complex problems Modern software’s complexity has no precedent  Abstractions are absolutely necessary to manage this complexity

7 Languages as Abstractions Human languages are a tool for abstracting thought  Example: “When I am warm I turn on the fan.” A statement communicates a simple intention The cognitive and neurological conditions from which the intention arose are most likely too complex for anyone to understand Meaning of the statement is left to the understanding of the individual who utters it and ones who hear it

8 Languages as Abstractions (cont’) Programming Languages  “Conceptual universe” (Perlis) Framework for problem-solving  A software tool for abstracting computation  Interface between clients and lower-level facilities (Implementation) Clients are usually humans or their programs Lower-level facilities can be files or operating systems  Example: if (temperature() > 30.0) { turn_on_fan(); } A statement involves a complex, but concrete sequence of actions Meaning of the statement is fixed by the formal semantics of the programming language and by the implementations of the functions

9 Evolution of Programming Languages Hardware Machine code Assembly Macro Assembly FORTRAN 1954 etc.  Programming in machine code or Assembly is way too tedious/error-prone

10 History of Programming Languages See the poster from O’Reilly

11 Why So Many Languages? Evolution  From goto to loops, case statements Personal Preference  Syntax  Loops vs. recursion  Pointers vs. recursive data types Special Purposes

12 Application Domains Scientific applications (Fortran, TCE) Business applications (Cobol) Artificial intelligence (LISP) Systems programming (C, C++) Web service programming (Java, C#) Very High-Level Languages (perl) Special purpose languages (make, sh)

13 What Makes a Language Succeed? Expressive Power Ease of Use for Novice Ease of Implementation Open Source Availability of Compilers, Libraries Economics, Patronage, Inertia Syntax that looks like C

14 Language Design Issues Readability Abstractions (functions, classes) Orthogonality (no special cases) Reliability (type checking) Cost (training programmers)

15 Why Do We Study Programming Languages? Understand obscure language features Choose among ways to express ideas Make good use of debuggers, other tools Simulate nice features in other languages Choose appropriate language for problem Learn new languages faster Design simple languages

16 Computation Models A computation model is a formal system that defines a language and how sentences of the language are executed by the abstract machine  i.e. how computations are done A programming paradigm is a style of programming a computer  A set of programming techniques and design principles to write programs in a language  Built on top of a computation model

17 Computation Models and Programming Paradigms Declarative Programming  Functional or logic programming Procedural/Imperative Programming Object-Oriented Programming Concurrent Programming  Multiple independent processes (running on the same CPU or distributed across multiple CPUs/computers)  Communication between processes via Dataflow Exchanging messages Sharing state

18 Languages for Programming Paradigms Functional programming  LISP/Scheme, ML, Haskell Logic programming  Prolog, SQL, Microsoft Excel Imperative programming  Fortran, Pascal, Basic, C Object-Oriented programming  Smalltalk, C++, Java, CLOS Concurrent programming for real-time systems  Erlang

19 Models with Which You Are Already Familiar You already know Java, which supports  Programming with state (Procedural/Imperative programming)  Object-oriented programming It is clear that these two models are important!

20 Languages in Common Use Compiled by François Labelle from statistics on open-source projects at SourceForge

21 Questions Worth Discussing for Programming Languages What is the structure (syntax) and meaning (semantics) of the programming language constructs? How does the compiler writer deal with these constructs in compilation? Is the programming language good for the programmer?  Easy to use?  Expressive power?  Readable?  Easy to detect programming error?

22 What’s New in Programming Languages Commercial trend over past 5 years  Increasing use of type-safe languages: Java, C#, …  Scripting languages, other languages for web applications Teaching trends  Java replacing C as most common introduction language Less emphasis on how data, control represented in machine Research and development trends  Modularity Java, C++: standardization of new module features  Program analysis Automated error detection, programming environment, compilation  Isolation and security Sandboxing, language-based security, …

23 What’s Worth Studying? Dominant languages and paradigms  C, C++, Java  Imperative and Object-oriented languages Important implementation ideas Performance challenges  Concurrency Design tradeoffs Concepts that research community is exploring for new programming languages and tools

24 Fundamental Concepts of Programming Languages Variables  declaration, binding, identifier, variable in memory, scope of a variable Identifier, Literals, Expressions Data types  integers, floating-point numbers, … Data structures  stack, queue, list, … Control structures  loops, conditional statements

25 Fundamental Concepts of Programming Languages (cont’) Function, procedures and parameter passing  definition, call (application) Recursion  For example, inductive definition of a function Block structures Runtime store organization

26 Implementation Methods Interpretation (early Lisp) Compilation (C, ML) Compiler Source Program Target Program InputOutput Interpreter Source Program Input Output

27 Implementation Methods (cont’) Hybrid Systems (early Java) Translator Source Program Intermediate Program Virtual Machine Input Output Intermediate Program

28 Overview of Compilation Scanner (Lexical Analysis) Parser (Syntax Analysis) Semantic Analysis and Intermediate Code Generation Machine-Independent Code Improvement (optional) Target Code Generation Machine-Specific Code Improvement (optional) Symbol Table Character Stream Token Stream Parse Tree Abstract Syntax Tree or Other Intermediate Form Assembly or Machine Language or Other Target Language Modified Target Language Modified Intermediate Form