Dr. Muhammed Al-Mulhem 1ICS535-101 ICS 535 Design and Implementation of Programming Languages Part 1 Introduction (Chapter 1)

Slides:



Advertisements
Similar presentations
An Introduction to Programming General Concepts. What is a program? A program is an algorithm expressed in a programming language. programming language.
Advertisements

Introduction to Programming Languages Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chapter 1: Preliminaries
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
Overview of Programming Paradigms
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.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Comp 205: Comparative Programming Languages Imperative Programming Languages Functional Programming Languages Semantics Other Paradigms Lecture notes,
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.
Dr. Muhammed Al-Mulhem ICS An Introduction to Functional Programming.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
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.
314450: PROGRAMMING PARADIGMS Teaching scheme: Examination Scheme: Lectures: 3 Hours/Week Theory: 100 Marks OBJECTIVE: To understand the basic building.
PROGRAMMING LANGUAGES The Study of Programming Languages.
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
High-Level Programming Languages: C++
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
Programming Languages and Design Lecture 1 Introduction to Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern University,
CS 363 Comparative Programming Languages
Programming Languages: History & Traditional Concepts CSC 2001.
Programming Languages Summer
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Software Architecture & Complexity By:- Pardesi Band Group
1 CSC 533: Organization of Programming Languages Spring 2010 See online syllabus at: Course goals:  understand issues in designing,
1 Programming Languages Marjan Sirjani Course web site:
1 Programming Language History and Evolution In Text: Chapter 2.
1 Concepts of Programming Languages TK 327, Fall 2015 MW 2:00 PM – 3:15 PM STV 104 Instructor:Dr. Chung-Chih Li Home page of the Class.
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.
Chapter 6 Programming Languages. © 2005 Pearson Addison-Wesley. All rights reserved 6-2 Chapter 6: Programming Languages 6.1 Historical Perspective 6.2.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Chapter 6 Programming Languages © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 6 Programming Languages (1) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Programming Domains 1.Scientific Applications Typically, scientific applications have simple data structures but require large numbers of floating-point.
Copyright © 2015 Pearson Education, Inc. Chapter 6: Programming Languages.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
1-1 An Introduction to Functional Programming Sept
Course No Programming Languages Theory & Practice First Semester ITTIHAD UNIVERSITY Computer Science Department Instructor: Dr. Rafiqul.
ISBN Structure of Programming Languages Prof. Dr. Mostafa Abdel Aziem Mostafa Senior Lecturer
Programming Languages
int k = Integer.MAX_VALUE; k++; int k = Integer.MAX_VALUE; k++; What happens when the following code executes? byte b = someFile.readByte(); b = (byte)(b.
CPS120: Introduction to Computer Science Variables and Constants.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
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,
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.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
PROGRAMMING LANGUAGES
Comp 205: Comparative Programming Languages
Chapter 6: Programming Languages
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
High Level Programming Languages
Chapter 6: Programming Languages
Principles of Programming Languages
School of Computer & Information Engineering,
Programming Languages, Preliminaries, History & Evolution
Presentation transcript:

Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Introduction (Chapter 1)

Dr. Muhammed Al-Mulhem 2ICS Programming Languages What is a programming language? What is a programming language? 1. A programming language is the medium of expression in the art of computer programming. [Mitchell] 2. Any notation for the description of algorithms and data structures may be termed as a programming language. [Pratt.]

Dr. Muhammed Al-Mulhem 3ICS Programming Languages (Cont.) What is a programming language? What is a programming language? No general consensus on the precise definition of programming language. Important aspects include function, target, constructs, and expressive power. Function: A programming language is a language used to write computer programs, which instruct a computer to perform some kind of computation and/or organize the flow of control between mechanical devices.computer programscomputation

Dr. Muhammed Al-Mulhem 4ICS Programming Languages (Cont.) Target: Programming languages differ from natural languages in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate instructions to machines. natural languages

Dr. Muhammed Al-Mulhem 5ICS Programming Languages (Cont.) Constructs: Programming languages may contain constructs for defining and manipulating data structures or for controlling the flow of execution.data structuresflow of execution Expressive power: The theory of computation classifies languages by the computations they can express.theory of computation

Dr. Muhammed Al-Mulhem 6ICS Taxonomy of Programming Languages Hundreds of programming languages have been devloped. Hundreds of programming languages have been devloped. No single overall classification scheme for programming languages. No single overall classification scheme for programming languages. One classification is the domain of use. One classification is the domain of use. Another classification by purpose like general purpose, system programming, scripting, and concurrent. Another classification by purpose like general purpose, system programming, scripting, and concurrent. Some languages have multiple characteristics like Java: Object-oriented and concurrent. Some languages have multiple characteristics like Java: Object-oriented and concurrent.

Dr. Muhammed Al-Mulhem 7ICS Taxonomy of Programming Languages Commonly, PLs are divided into programming paradigms (procedural/imperative, object-oriented, functional, and logic). Commonly, PLs are divided into programming paradigms (procedural/imperative, object-oriented, functional, and logic).

Dr. Muhammed Al-Mulhem 8ICS Programming Languages Diversity One of the things that makes programming languages so fascinating is their diversity. One of the things that makes programming languages so fascinating is their diversity. Imperative Languages Imperative Languages int fact (int n) { int sofar = 1; while ( n > 0 ) sofar *= n--; return sofar; } Functional Languages Functional Languages (defun fact (x) (if ( <= x 0 ) 1 (* x (fact ( - x 1)))))

Dr. Muhammed Al-Mulhem 9ICS Programming Languages Diversity Logic Programming Languages Logic Programming Languages fact(1, 1). fact(N, M) :- X is N – 1, fact(X, Y), M is N * Y.

Dr. Muhammed Al-Mulhem 10ICS Programming Languages Diversity Object-Oriented Languages Object-Oriented Languages public class MyInt { private int value; public MyInt (int value) { this.value = value; this.value = value;} public int getValue() { return value; return value;} public MyInt getFact() { return new MyInt (fact(value)); return new MyInt (fact(value));} private int fact(int n) { int sofar = 1; int sofar = 1; while (n > 1) sofar *= n--; return sofar; }}

Dr. Muhammed Al-Mulhem 11ICS Criteria for a good programming language An ideal programming language will make it easy for programmers to write programs concisely and clearly. An ideal programming language will make it easy for programmers to write programs concisely and clearly. A good programming language will help others read programs and understand how they work. A good programming language will help others read programs and understand how they work. A good language for large-scale programming will help programmers manage the interaction among software components effectively. A good language for large-scale programming will help programmers manage the interaction among software components effectively.

Dr. Muhammed Al-Mulhem 12ICS Trade-offs in Programming Language Design Some language features make it easy for us to write programs quickly, but may make it harder for us to design testing tools or methods. Some language features make it easy for us to write programs quickly, but may make it harder for us to design testing tools or methods. Some language constructs make it easier for a compiler to optimize programs, but may make programming cumbersome. Some language constructs make it easier for a compiler to optimize programs, but may make programming cumbersome. Different computing environments and applications require different program characteristics, different programming language designers have chosen different trade-offs. Different computing environments and applications require different program characteristics, different programming language designers have chosen different trade-offs. One reason for discussing historical languages is that this gives us a realistic way to understand programming language design trade-offs. One reason for discussing historical languages is that this gives us a realistic way to understand programming language design trade-offs.

Dr. Muhammed Al-Mulhem 13ICS Trade-offs Example APL (named after the book A Programming Language)[5] is an interactive array-oriented language APL (named after the book A Programming Language)[5] is an interactive array-oriented language[5]interactivearray-oriented language[5]interactivearray-oriented language It is concise, using symbols rather than words and applying functions to entire arrays without using explicit loops. It is concise, using symbols rather than words and applying functions to entire arrays without using explicit loops.arrays An expression to find all prime numbers from 1 to R. An expression to find all prime numbers from 1 to R.prime numbersprime numbers (~R ∊ R ∘.×R)/R←1↓ ⍳ R

Dr. Muhammed Al-Mulhem 14ICS (~R ∊ R ∘.×R)/R←1↓ ⍳ R Executed from right to left, this means: Executed from right to left, this means: ιR creates a vector containing integers from 1 to R (if R = 6 at the beginning of the program, ιR is ) ιR creates a vector containing integers from 1 to R (if R = 6 at the beginning of the program, ιR is )integers Drop first element of this vector (↓ function), i.e. 1. So 1↓ιR is Drop first element of this vector (↓ function), i.e. 1. So 1↓ιR is Set R to the new vector (←, assignment primitive), i.e Set R to the new vector (←, assignment primitive), i.e Generate outer product of R multiplied by R, i.e. a matrix which is the multiplication table of R by R (°.× function), i.e. Generate outer product of R multiplied by R, i.e. a matrix which is the multiplication table of R by R (°.× function), i.e.outer productmultiplication tableouter productmultiplication table Build a vector the same length as R with 1 in each place where the corresponding number in R is in the outer product matrix (ε, set inclusion function), i.e Build a vector the same length as R with 1 in each place where the corresponding number in R is in the outer product matrix (ε, set inclusion function), i.e Logically negate the values in the vector (~, negation function), i.e Logically negate the values in the vector (~, negation function), i.e Select the items in R for which the corresponding element is 1 (/ function), i.e Select the items in R for which the corresponding element is 1 (/ function), i.e

Dr. Muhammed Al-Mulhem 15ICS PLs Histroy 1950s Algol, Cobol, Fortran, Lisp 1950s Algol, Cobol, Fortran, Lisp 1980sObject-orientation 1980sObject-orientation 1990sNetwork-centered computing 1990sNetwork-centered computing 2000sDiversity of computing devices, wireless and cellular computing. 2000sDiversity of computing devices, wireless and cellular computing.

Dr. Muhammed Al-Mulhem 16ICS A Summary of Concepts and Languages ThreadsObjectsExceptionsFunctionsExpressionsLanguage LISP C Pascal Smalltalk C++ ML Java

Dr. Muhammed Al-Mulhem 17ICS Programming Languages Development Two main aspects: Design and Implementation Two main aspects: Design and Implementation Design: Two specifications Design: Two specifications Syntax Syntax Semantics Semantics Implementation: Two approaches: Implementation: Two approaches: Interpretation Interpretation Compilation Compilation