Programming Languages 3 2013–14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.

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.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics Fall 2005.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
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.
1 ) Definition 2) Note on structured and modular programming, and information hiding 3) Example imperative languages 4) Features of imperative languages.
Programming Languages Structure
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
Dr. Muhammed Al-Mulhem ICS An Introduction to Functional Programming.
CS 331, Principles of Programming Languages Introduction.
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.
Introduction to Programming G50PRO University of Nottingham Unit 1 : Introduction Paul Tennent
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.
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.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
CS2303 C14 Systems Programming Concepts Bob Kinicki.
Chapter 1. Introduction.
LANGUAGE TRANSLATORS: WEEK 24 TRANSLATION TO ‘INTERMEDIATE’ CODE (overview) Labs this week: Tutorial Exercises on Code Generation.
By Neng-Fa Zhou1 Evolution of programming languages –Machine language –Assembly language –Sub-routines and loop (Fortran) –Procedures and recursion (Algol,
Programming Languages and Design Lecture 7 Subroutines and Control Abstraction Instructor: Li Ma Department of Computer Science Texas Southern University,
February 25, ICE 1341 – Programming Languages (Lecture #1) In-Young Ko Programming Languages (ICE 1341) Lecture #1 Programming Languages (ICE 1341)
Bindings and scope  Bindings and environments  Scope and block structure  Declarations Programming Languages 3 © 2012 David A Watt, University.
1 Programming Languages Marjan Sirjani Course web site:
1 Programming Language History and Evolution In Text: Chapter 2.
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.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
CS112: Structure of Programming Languages A smorgasbord of topics in programming languages including programming paradigms and syntax, semantics, implementation.
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Programming Language 1. Programming language A programming language is a machine-readable artificial language designed to express computations that can.
Programming Languages
CS 331, Principles of Programming Languages Chapter 1.
Logical and Functional Programming
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
1-1 An Introduction to Functional Programming Sept
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
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.
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,
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Language Paradigms CS655.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming Language History and Evolution
Chapter 1. Introduction.
Programming Languages 2nd edition Tucker and Noonan
The language focusses on ease of use
Concepts of Programming Languages
Introduction to programming languages, Algorithms & flowcharts
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Concepts of Programming Languages
Why study programming languages?
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
Programming Language Design Concepts
Programming Language History and Evolution
Evolution of programming languages
Introduction to programming languages, Algorithms & flowcharts
CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics
Programming Languages 2nd edition Tucker and Noonan
Principles of Programming Languages
Overview of Programming Paradigms
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Presentation transcript:

Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David A Watt, University of Glasgow

0-2 Aims  Syntax: To show you how the syntax of a programming language can be formalized.  Concepts: To provide a conceptual framework that will enable you to understand familiar programming languages more deeply and learn new languages more efficiently.  Implementation: To explain the functions of compilers and interpreters, how they interact, how they work, and how they can be constructed using suitable tools.

0-3 Prerequisites  Knowledge and experience of Java –essential.  Knowledge and experience of other programming languages such as Python and C –highly desirable.  Understanding of elementary discrete mathematics, particularly sets and functions –highly desirable.

0-4 Contents (1) 1.Syntax (wk1) 2.Values and types (wk2) 3.Compilers and interpreters (wk3) 4.Interpretation (wk4) 5.Compilation (wk4) 6.Syntactic analysis (wk5) 7.Contextual analysis (wk6) 8.VM code generation (wk7) Concepts Syntax Implementation

0-5 Contents (2) 9.Variables and lifetime (wk8) 10.Bindings and scope (wk8) 11.Procedural abstraction (wk9) 12.Data abstraction (wk9) 13.Generic abstraction (wk9) 14.Run-time organization (wk10) 15.Native code generation (wk10) Concepts (continued) Implementation (continued)

0-6 Coursework and assessment  Tutorial exercises (self-assessed)  Coursework assignment (summative, 20%) –extensions to a small compiler, using a compiler generation tool  Examination (summative, 80%) –syntax (10 marks) –concepts (20 marks) –implementation (30 marks)

0-7 Programming languages  In this course we study programming languages (PLs).  Each PL has its own syntax and semantics.  PLs must be expressive enough to express all computations.  Computing scientists can design, specify, and implement new PLs. in much the same way as linguists study natural languages (NLs) like an NL but much less expressive than NLs whereas linguists are limited to studying existing NLs

0-8 What is a programming language? (1)  A PL must be universal – capable of expressing any computation. –A language without iteration or recursion would not be universal. –The lambda calculus – a language of recursive functions and nothing else – is universal.  A PL should be reasonably natural for expressing computations in its intended area. –C is natural for systems programming. –Java is natural for applications. –Python is natural for scripting.

0-9 What is a programming language? (2)  A PL must be implementable: –it must be possible to run every program in that PL on a computer –as long as the computer has enough memory.  A PL should be capable of reasonably efficient implementation. –Running a program should not require an unreasonable amount of time or memory. –What is reasonable depends on the context. E.g., Python is slow, but acceptable for scripting applications; it would not be acceptable for systems.

0-10 Syntax and semantics  The syntax of a PL is concerned with the form of programs: how expressions, commands, declarations, and other constructs must be arranged to make a well-formed program.  The semantics of a PL is concerned with the meaning of well-formed programs: how a program may be expected to behave when run on a machine.  Semantics underlies all programming, and language implementation. Syntax provides a structure on which semantics can be defined.

0-11 Design concepts (1)  Design concepts are the building blocks of PLs: –values and types –variables and storage –bindings and scope –procedural abstraction –data abstraction –generic abstraction –processes and communication (not covered here).

0-12 Design concepts (2)  A paradigm is a style of programming, characterized by a selection of key concepts. –Functional programming focuses on values, expressions, and functions. –Imperative programming focuses on variables, commands (“statements”), and procedures. –Object-oriented (OO) programming focuses on objects, methods, and classes. –Concurrent programming focuses on processes and communication.  Understanding of design concepts and paradigms enables us to select PLs for a project.

0-13 Implementation  A program expressed in a PL cannot be run directly by a machine. Instead it must be processed by an interpreter or compiler.  An interpreter runs the given program by fetching, analysing, and executing its ‘instructions’, one at a time.  A compiler translates the given program from the PL to lower-level code  Understanding of how PLs are implemented enables us to be more skilful programmers.

0-14 Reading (1)  David Watt Programming Language Design Concepts Wiley 2004 ISBN –recommended reading for the Concepts part of this course (particularly Chapters 2–7).

0-15 Reading (2)  David Watt and Deryck Brown Programming Language Processors in Java Prentice Hall 2000 ISBN –background reading for the Implementation part of this course.  Andrew Appel Modern Compiler Implementation in Java Cambridge 1998 ISBN –additional reading –covers all aspects of compilation in detail, including native code generation and optimization.

OOimperativeconcurrentfunctionalscripting History of programming languages (1) Fortran Lisp Simula Smalltalk ML PL/I Algol68 C++ Ada83 C Cobol Modula Pascal Algol60 Perl Unix

OO imperativeconcurrentfunctional C# Java5 Java Ada95 Haskell History of programming languages (2) scripting C++ Ada83 Perl Python 2010