1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 1: Introduction COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos.

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

1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 3: Lexical Analysis COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos.
you admittance to the “show”.
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 20: Lists and Higher-Order Functions in Haskell COMP 144 Programming Language Concepts.
Reasons to study concepts of PL
CS 101 Course Summary December 5, Big Ideas Abstraction Problem solving Fundamentals of programming.
HASKELL Presentation Programming Segment
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 32: The Java Virtual Machine COMP 144 Programming Language Concepts Spring 2002.
COMP205 Comparative Programming Languages
Programming Languages Structure
CSI Fall 2002 Dr. William A. Maniatty Assistant Prof. Dept. of Computer Science University At Albany Programming Languages and Systems Concepts Fall.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 34: Code Optimization COMP 144 Programming Language Concepts Spring 2002 Felix.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 24: Dynamic Binding COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos.
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Functional Programming Notes for CSCE 190 Based on Sebesta,
Comp 205: Comparative Programming Languages Imperative Programming Languages Functional Programming Languages Semantics Other Paradigms Lecture notes,
Presented by Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 35: In-line Expansion and Local Optimization COMP 144 Programming Language Concepts.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 19: Functions, Types and Data Structures in Haskell COMP 144 Programming Language.
CS 331, Principles of Programming Languages Introduction.
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
314450: PROGRAMMING PARADIGMS Teaching scheme: Examination Scheme: Lectures: 3 Hours/Week Theory: 100 Marks OBJECTIVE: To understand the basic building.
C H A P T E R O N E Overview.
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
ITEC 380 Organization of programming languages Dr. Andrew Ray.
CS 326 Programming Languages, Concepts and Implementation
Programming Languages and Design Lecture 1 Introduction to Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern University,
Chapter 1. Introduction.
CS 363 Comparative Programming Languages
Programming Languages Summer
Chapter 1 - Introduction
By Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion (Algol,
Principles of Programming Languages Asst. Prof. Dr. Ahmet Sayar Spring-2012 Kocaeli University Computer Engineering Department Introduction.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
1 Lecture 1: Introduction (Sections ) CSCI 431 Programming Languages Fall 2002 A modification of slides developed by Felix Hernandez-Campos at UNC.
Programming Languages Design Considerations (Qualities) Readability –Simplicity and Clarity –Orthogonality –Control Statements –Data Types and Structures.
HASKELL!. I NTRODUCTION W HAT IS H ASKELL ? Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy,
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05.
Programming Languages
CS 331, Principles of Programming Languages Chapter 1.
H ASKELL. I NTRODUCTION W HAT IS H ASKELL ? Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy,
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
CPS120: Introduction to Computer Science Variables and Constants.
LECTURE 1 Overview and History. COURSE OBJECTIVE As I stated before, our ultimate objective in this course is to provide you with the knowledge and skills.
CSCE 314 Programming Languages
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Programming Languages CSCI-4430 & CSCI-6430, Spring Ana Milanova Lally Hall 314,
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
CSCE 343 – Programming Language Concepts Welcome!.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Chapter 1. Introduction.
Programming Languages 2nd edition Tucker and Noonan
PROGRAMMING LANGUAGES
CS 326 Programming Languages, Concepts and Implementation
Lecture 39: Case Study: C# and .NET
Lecture 16: Introduction to Data Types
Comp 205: Comparative Programming Languages
课程名 编译原理 Compiling Techniques
Evolution of programming languages
Introduction (Sections )
Programming Languages 2nd edition Tucker and Noonan
Programming Languages and Paradigms
Overview of Programming Paradigms
School of Computer & Information Engineering,
Programming Languages, Preliminaries, History & Evolution
Presentation transcript:

1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 1: Introduction COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos Jan 9 The University of North Carolina at Chapel Hill

2 COMP 144 Programming Language Concepts Felix Hernandez-Campos Programming Languages What is a programming language?What is a programming language? Programming Language

3 COMP 144 Programming Language Concepts Felix Hernandez-Campos Programming Languages What is a programming language?What is a programming language? –Abstraction of virtual machine int sum(int[] x) { int sum = 0; int sum = 0; n = 0; n = 0; while (n < x.length) { while (n < x.length) { sum += x[n]; sum += x[n]; } return sum; return sum;}

4 COMP 144 Programming Language Concepts Felix Hernandez-Campos Programming Languages What is a programming language?What is a programming language? –Donald Knuth: »Programming is the art of telling another human being what one wants the computer to do int sum(int[] x) { int sum = 0; int sum = 0; n = 0; n = 0; while (n < x.length) { while (n < x.length) { sum += x[n]; sum += x[n]; } return sum; return sum;}

5 COMP 144 Programming Language Concepts Felix Hernandez-Campos The Number of Programming Languages How many programming languages do you know?How many programming languages do you know? –This is a sample list… » Why is the number of programming languages so large?Why is the number of programming languages so large? –Evolution –Special Purpose –Personal Preference

6 COMP 144 Programming Language Concepts Felix Hernandez-Campos The Number of Programming Languages How many programming languages do you know?How many programming languages do you know? –This is a sample list… This is a sample list…This is a sample list… » Why is the number of programming languages so large?Why is the number of programming languages so large? –Evolution –Special Purpose –Personal Preference

7 COMP 144 Programming Language Concepts Felix Hernandez-Campos Evolution: Genealogy From Sebesta’s Concepts of ProgrammingLanguages Haskell PrologSWI-Prolog

8 COMP 144 Programming Language Concepts Felix Hernandez-Campos The Number of Programming Languages How many programming languages do you know?How many programming languages do you know? –This is a sample list… This is a sample list…This is a sample list… » Why is the number of programming languages so large?Why is the number of programming languages so large? –Evolution –Special Purpose –Personal Preference

9 COMP 144 Programming Language Concepts Felix Hernandez-Campos The Number of Programming Languages How many programming languages do you know?How many programming languages do you know? –This is a sample list… This is a sample list…This is a sample list… » Why is the number of programming languages so large?Why is the number of programming languages so large? –Evolution –Special Purpose –Personal Preference

10 COMP 144 Programming Language Concepts Felix Hernandez-Campos The Number of Programming Languages How many programming languages do you know?How many programming languages do you know? –This is a sample list… This is a sample list…This is a sample list… » Why is the number of programming languages so large?Why is the number of programming languages so large? –Evolution –Special Purpose –Personal Preference A programming language is a way of thinkingA programming language is a way of thinking –Different people think in a different way

11 COMP 144 Programming Language Concepts Felix Hernandez-Campos Quicksort in C qsort( a, lo, hi ) int a[], hi, lo; { int h, l, p, t; if (lo < hi) { l = lo; h = hi; p = a[hi]; do { while ((l < h) && (a[l] <= p)) l = l+1; while ((h > l) && (a[h] >= p)) h = h-1; if (l < h) {

12 COMP 144 Programming Language Concepts Felix Hernandez-Campos Quicksort in C t = a[l]; a[l] = a[h]; a[h] = t; } } while (l < h); t = a[l]; a[l] = a[hi]; a[hi] = t; qsort( a, lo, l-1 ); qsort( a, l+1, hi ); }

13 COMP 144 Programming Language Concepts Felix Hernandez-Campos Quicksort in Haskell qsort [] = [] qsort (x:xs) = qsort lt_x ++ [x] ++ qsort ge_x where lt_x = [y | y <- xs, y < x] ge_x = [y | y = x]

14 COMP 144 Programming Language Concepts Felix Hernandez-Campos Successful Programming Languages Are all languages equally successful?Are all languages equally successful? –No! What makes a language successful?What makes a language successful? –Expressive power –Ease of use for the novice –Ease of implementation –Excellent compilers –Economics, patronage, and inertia

15 COMP 144 Programming Language Concepts Felix Hernandez-Campos Why study programming languages? Use the most appropriate programming language for your taskUse the most appropriate programming language for your task –E.g. Java is great for writing applications –E.g. C is great for systems programming Make it easier to learn new languagesMake it easier to learn new languages –Evolution => Similarities Make good better use of language featuresMake good better use of language features –Obscure features –Cost of features –Simulate useful features

16 COMP 144 Programming Language Concepts Felix Hernandez-Campos Classification of Programming Languages Imperative languagesImperative languages –What the computer is to do Von Neumann languagesVon Neumann languages »E.g. Fortran, Basic, C Object-oriented languagesObject-oriented languages »E.g. C++, Java

17 COMP 144 Programming Language Concepts Felix Hernandez-Campos Classification of Programming Languages Declarative languagesDeclarative languages –How the computer should do it Functional languagesFunctional languages –E.g. Lisp, ML, and Haskell Dataflow languagesDataflow languages –E.g. Id and Val Logic or constraint-based languagesLogic or constraint-based languages –E.g. Prolog

18 COMP 144 Programming Language Concepts Felix Hernandez-Campos Summary Programming languages:Programming languages: –Set of abstractions => virtual machine –A way of thinking COMP 144:COMP 144: –Examine the fundamental principles of contemporary programming languages »Design »Implementation –Program in four completely different programming languages »Practical experience