G22.2110 Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness types and their operations.

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
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.
CS 355 – Programming Languages
A brief history of programming languages
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.
G Programming Languages G Walter Williams.
High-Level Programming Languages
Programming Languages Structure
G Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness Abstraction mechanisms control.
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
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.
G Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness types and their operations.
1 Programming Languages Marjan Sirjani 2 1- The Study of Programming Languages The purpose of language is simply that it must convey meaning. (Confucius)
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
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)
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
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.
ISBN Chapter 2 Evolution of the Major Programming Languages.
Principles of Programming Languages Course Introduction Vasudeva Varma Venkatesh Choppella Monsoon Semester 2009 IIIT Hyderabad.
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
Chapter 1 - Introduction
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.
Programming Languages Design Considerations (Qualities) Readability –Simplicity and Clarity –Orthogonality –Control Statements –Data Types and Structures.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
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.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Chapter 8 High-Level Programming Languages. 2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Logical and Functional Programming
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 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.
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.
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,
Advanced programming language theory. week 2. Attribute grammars and semantics.
Programming Language Paradigms ITSK2314 Lecture 3.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
History. Development Driven by Function Functions of a Programming Language –To describe computation for use by computers –To describe computation and.
Language Paradigms CS655.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming Language History and Evolution
Programming Languages 2nd edition Tucker and Noonan
Zuse’s Plankalkül – 1945 Never implemented Problems Zuse Solved
Why study programming languages?
Programming Language History and Evolution
Ada – 1983 History’s largest design effort
Programming Languages
Programming Language Design
Programming Languages 2nd edition Tucker and Noonan
Principles of Programming Languages
Overview of Programming Paradigms
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Presentation transcript:

G Programming Languages T he main themes of programming language design and use: –Model of computation –Expressiveness types and their operations control structures abstraction mechanisms tools for programming in the large –Ease of use: Writability / Readability / Maintainability

Models of Computation Imperative: programs have mutable storage (state) modified by assignments (Turing machines) –by far the most common and familiar Functional (applicative): programs are pure functions (Church: recursive function theory) –much use in AI, formal semantics, language research Declarative: programs are unordered sets of assertions and rules (Colmerauer, Kowalski) –Prolog, data base applications

Genealogy FORTRAN (1957) => Fortran90, HPF COBOL (1956) => COBOL2000 –still a large chunk of all installed software Algol60 => Algol68 => Pascal => Ada Algol60 => BCPL => C Simula => Smalltalk, C++ LISP => Scheme, ML, Haskell –with plenty of cross-influences: Java inherits from C++, Smalltalk, LISP, Ada, etc.

Common Ideas Modern imperative languages (Ada, C++, Java) have similar characteristics: –large number of features (grammar with several hundred productions, 500 page reference manuals…) –a rich type system –procedural mechanisms –object-oriented facilities –abstraction mechanisms, with information hiding –several storage-allocation mechanisms –facilities for concurrent programming (not C++) –facilities for generic programming (not Java)

Functional Languages The focus of much academic research First high-level language: LISP –Dynamically typed –Interpreted –Garbage-Collected –Extensible Current emphasis: type systems, statically typed languages, ideas from object-oriented programming: ML, Haskell, others

Logic Languages Goal: use logic to describe algorithms Natural for search problems: theorem proving Non-determinism is fundamental In principle: decouples problem statement from algorithm coding: the description IS the algorithm In practice: programmer needs an operational understanding of the language, else Prolog is the best way to program infinite loops…

Trends in Language design Software developers ask for more features. –See size of C++ Theoreticians ask for features with clean semantics. –Compare with size of ML Developers of mission-critical software want features that are easier to verify formally. –Ada Ravenscar subset, automotive C subset. Compiler writers want features that are orthogonal, so that their implementation is modular. These goals are often in conflict –Compare POPL, PLDI, Software Practice and Experience

A specialized area: real-time languages Reactive systems: computation never terminates, environment provides inputs in asynchronous fashion, system has timing constraints, system failure includes deadlock, livelock, indefinite blocking etc. Novel approaches: Statecharts, Esterel In conventional languages: need to talk about time, duration, synchronization (Ada, Java). Hard to disentangle computation from timing behavior, but most developers do it.

Predictable performance vs. ease of writing Low-level languages mirror the physical machine: –Assembly, C, Fortran High-level languages model an abstract machine with useful capabilities: –ML, Setl, Prolog, Python Wide-spectrum languages try to do both, more or less well: –Ada, C++, Java High-level languages are often interpreted, have garbage collector,are dynamically typed,and cannot be used for real- time programming. Cost of operations is not directly visible. –Java is a hybrid

Language as a tool for thought (Iverson) Drawing a histogram in APL: – “ *“ [ V °   V] –Is it natural ? ( only if you happen to think that way) –Role of language as a communication vehicle among programmers is more important than ease of writing –APL is an extreme case (write-only language) –All languages have the same expressive power; arguments of the form “you can’t do this in X” are meaningless. –But.. Idioms in language A may be useful inspiration when writing in language B.

The programming environment may be larger than the language The predefined libraries are indispensable to the proper use of the language. The libraries are defined in the language itself, but they have to be internalized by a good programmer. the C++ standard template library The Java Swing classes The Ada I/O and numeric packages There is a law of conservation of junk: whether it goes into the language or in the library, the total amount of miscellaneous information is roughly the same from language to language.

Language Definition Different users have different needs: –programmers tutorials, reference manuals, programming guides (idioms) –implementors precise operational semantics –verifiers rigorous axiomatic or natural semantics –language designers and language lawyers all of the above Different levels of detail and precision –But none of them can be sloppy!

Syntax and Semantics Syntax refers to external representation Semantics denotes meaning Distinction is convenient but arbitrary: can describe fully a programming language by syntactic means (Algol68 and W-grammars), but resulting grammar is hard to use. In practice, describe context-free aspects with a grammar, the rest with prose or a different formal notation (equations, pre/post conditions, assertions).