CONCEPTS IN PROGRAMMING LANGUAGES. John C. Mitchell Stanford University

Size: px
Start display at page:

Download "CONCEPTS IN PROGRAMMING LANGUAGES. John C. Mitchell Stanford University"

Transcription

1 CONCEPTS IN PROGRAMMING LANGUAGES John C. Mitchell Stanford University

2 published by the press syndicate of the university of cambridge The Pitt Building, Trumpington Street, Cambridge, United Kingdom cambridge university press The Edinburgh Building, Cambridge CB2 2RU, UK 40 West 20th Street, New York, NY , USA 477 Williamstown Road, Port Melbourne, VIC 3207, Australia Ruiz de Alarcón 13, Madrid, Spain Dock House, The Waterfront, Cape Town 8001, South Africa C Cambridge University Press 2002 This book is in copyright. Subject to statutory exception and to the provisions of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published 2002 Printed in the United States of America Typefaces Times Ten 10/12.5 pt., ITC Franklin Gothic, and Officina Serif System LATEX2ε [tb] A catalog record for this book is available from the British Library. Library of Congress Cataloging in Publication data available. ISBN hardback

3 Contents Preface page ix Part 1 Functions and Foundations 1 Introduction Programming Languages Goals Programming Language History Organization: Concepts and Languages 8 2 Computability Partial Functions and Computability Chapter Summary 16 Exercises 16 3 Lisp: Functions, Recursion, and Lists Lisp History Good Language Design Brief Language Overview Innovations in the Design of Lisp Chapter Summary: Contributions of Lisp 39 Exercises 40 4 Fundamentals Compilers and Syntax Lambda Calculus Denotational Semantics Functional and Imperative Languages Chapter Summary 82 Exercises 83 v

4 vi Contents Part 2 Procedures, Types, Memory Management, and Control 5 The Algol Family and ML The Algol Family of Programming Languages The Development of C The LCF System and ML The ML Programming Language Chapter Summary 121 Exercises Type Systems and Type Inference Types in Programming Type Safety and Type Checking Type Inference Polymorphism and Overloading Type Declarations and Type Equality Chapter Summary 155 Exercises Scope, Functions, and Storage Management Block-Structured Languages In-Line Blocks Functions and Procedures Higher-Order Functions Chapter Summary 190 Exercises Control in Sequential Languages Structured Control Exceptions Continuations Functions and Evaluation Order Chapter Summary 227 Exercises 228 Part 3 Modularity, Abstraction, and Object-Oriented Programming 9 Data Abstraction and Modularity Structured Programming Language Support for Abstraction Modules Generic Abstractions Chapter Summary 269 Exercises Concepts in Object-Oriented Languages Object-Oriented Design Four Basic Concepts in Object-Oriented Languages 278

5 Contents vii 10.3 Program Structure Design Patterns Chapter Summary Looking Forward: Simula, Smalltalk, C++, Java 293 Exercises History of Objects: Simula and Smalltalk Origin of Objects in Simula Objects in Simula Subclasses and Subtypes in Simula Development of Smalltalk Smalltalk Language Features Smalltalk Flexibility Relationship between Subtyping and Inheritance Chapter Summary 326 Exercises Objects and Run-Time Efficiency: C Design Goals and Constraints Overview of C Classes, Inheritance, and Virtual Functions Subtyping Multiple Inheritance Chapter Summary 366 Exercises Portability and Safety: Java Java Language Overview Java Classes and Inheritance Java Types and Subtyping Java System Architecture Security Features Java Summary 417 Exercises 420 Part 4 Concurrency and Logic Programming 14 Concurrent and Distributed Programming Basic Concepts in Concurrency The Actor Model Concurrent ML Java Concurrency Chapter Summary 466 Exercises 469

6 viii Contents 15 The Logic Programming Paradigm and Prolog History of Logic Programming Brief Overview of the Logic Programming Paradigm Equations Solved by Unification as Atomic Actions Clauses as Parts of Procedure Declarations Prolog s Approach to Programming Arithmetic in Prolog Control, Ambivalent Syntax, and Meta-Variables Assessment of Prolog Bibliographic Remarks Chapter Summary 507 Appendix A Additional Program Examples 509 A.1 Procedural and Object-Oriented Organization 509 Glossary 521 Index 525

7 1 Introduction The Medium Is the Message Marshall McLuhan 1.1 PROGRAMMING LANGUAGES Programming languages are the medium of expression in the art of computer programming. An ideal programming language will make it easy for programmers to write programs succinctly and clearly. Because programs are meant to be understood, modified, and maintained over their lifetime, a good programming language will help others read programs and understand how they work. Software design and construction are complex tasks. Many software systems consist of interacting parts. These parts, or software components, may interact in complicated ways. To manage complexity, the interfaces and communication between components must be designed carefully. A good language for large-scale programming will help programmers manage the interaction among software components effectively. In evaluating programming languages, we must consider the tasks of designing, implementing, testing, and maintaining software, asking how well each language supports each part of the software life cycle. There are many difficult 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 constructs make it easier for a compiler to optimize programs, but may make programming cumbersome. Because different computing environments and applications require different program characteristics, different programming language designers have chosen different tradeoffs. In fact, virtually all successful programming languages were originally designed for one specific use. This is not to say that each language is good for only one purpose. However, focusing on a single application helps language designers make consistent, purposeful decisions. A single application also helps with one of the most difficult parts of language design: leaving good ideas out. 3

8 4 Introduction THE AUTHOR I hope you enjoy using this book. At the beginning of each chapter, I have included pictures of people involved in the development or analysis of programming languages. Some of these people are famous, with major awards and published biographies. Others are less widely recognized. When possible, I have tried to include some personal information based on my encounters with these people. This is to emphasize that programming languages are developed by real human beings. Like most human artifacts, a programming language inevitably reflects some of the personality of its designers. As a disclaimer, let me point out that I have not made an attempt to be comprehensive in my brief biographical comments. I have tried to liven up the text with a bit of humor when possible, leaving serious biography to more serious biographers. There simply is not space to mention all of the people who have played important roles in the history of programming languages. Historical and biographical texts on computer science and computer scientists have become increasingly available in recent years. If you like reading about computer pioneers, you might enjoy paging through Out of Their Minds: The Lives and Discoveries of 15 Great Computer Scientists by Dennis Shasha and Cathy Lazere or other books on the history of computer science. John Mitchell Even if you do not use many of the programming languages in this book, you may still be able to put the conceptual framework presented in these languages to good use. When I was a student in the mid-1970s, all serious programmers (at my university, anyway) used Fortran. Fortran did not allow recursion, and recursion was generally regarded as too inefficient to be practical for real programming. However, the instructor of one course I took argued that recursion was still an important idea and explained how recursive techniques could be used in Fortran by managing data in an array. I am glad I took that course and not one that dismissed recursion as an impractical idea. In the 1980s, many people considered object-oriented programming too inefficient and clumsy for real programming. However, students who learned about object-oriented programming in the 1980s were certainly happy to know about

9 1.2 Goals 5 these futuristic languages in the 1990s, as object-oriented programming became more widely accepted and used. Although this is not a book about the history of programming languages, there is some attention to history throughout the book. One reason for discussing historical languages is that this gives us a realistic way to understand programming language trade-offs. For example, programs were different when machines were slow and memory was scarce. The concerns of programming language designers were therefore different in the 1960s from the current concerns. By imaging the state of the art in some bygone era, we can give more serious thought to why language designers made certain decisions. This way of thinking about languages and computing may help us in the future, when computing conditions may change to resemble some past situation. For example, the recent rise in popularity of handheld computing devices and embedded processors has led to renewed interest in programming for devices with limited memory and limited computing power. When we discuss specific languages in this book, we generally refer to the original or historically important form of a language. For example, Fortran means the Fortran of the 1960s and early 1970s. These early languages were called Fortran I, Fortran II, Fortran III, and so on. In recent years, Fortran has evolved to include more modern features, and the distinction between Fortran and other languages has blurred to some extent. Similarly, Lisp generally refers to the Lisps of the 1960s, Smalltalk to the language of the late 1970s and 1980s, and so on. 1.2 GOALS In this book we are concerned with the basic concepts that appear in modern programming languages, their interaction, and the relationship between programming languages and methods for program development. A recurring theme is the trade-off between language expressiveness and simplicity of implementation. For each programming language feature we consider, we examine the ways that it can be used in programming and the kinds of implementation techniques that may be used to compile and execute it efficiently General Goals In this book we have the following general goals: To understand the design space of programming languages. This includes concepts and constructs from past programming languages as well as those that may be used more widely in the future. We also try to understand some of the major conflicts and trade-offs between language features, including implementation costs. To develop a better understanding of the languages we currently use by comparing them with other languages. To understand the programming techniques associated with various language features. The study of programming languages is, in part, the study of conceptual frameworks for problem solving, software construction, and development.

10 6 Introduction Many of the ideas in this book are common knowledge among professional programmers. The material and ways of thinking presented in this book should be useful to you in future programming and in talking to experienced programmers if you work for a software company or have an interview for a job. By the end of the course, you will be able to evaluate language features, their costs, and how they fit together Specific Themes Here are some specific themes that are addressed repeatedly in the text: Computability: Some problems cannot be solved by computer. The undecidability of the halting problem implies that programming language compilers and interpreters cannot do everything that we might wish they could do. Static analysis: There is a difference between compile time and run time. At compile time, the program is known but the input is not. At run time, the program and the input are both available to the run-time system. Although a program designer or implementer would like to find errors at compile time, many will not surface until run time. Methods that detect program errors at compile time are usually conservative, which means that when they say a program does not have a certain kind of error this statement is correct. However, compile-time errordetection methods will usually say that some programs contain errors even if errors may not actually occur when the program is run. Expressiveness versus efficiency: There are many situations in which it would be convenient to have a programming language implementation do something automatically. An example discussed in Chapter 3 is memory management: The Lisp run-time system uses garbage collection to detect memory locations no longer needed by the program. When something is done automatically, there is a cost. Although an automatic method may save the programmer from thinking about something, the implementation of the language may run more slowly. In some cases, the automatic method may make it easier to write programs and make programming less prone to error. In other cases, the resulting slowdown in program execution may make the automatic method infeasible. 1.3 PROGRAMMING LANGUAGE HISTORY Hundreds of programming languages have been designed and implemented over the last 50 years. As many as 50 of these programming languages contained new concepts, useful refinements, or innovations worthy of mention. Because there are far too many programming languages to survey, however, we concentrate on six programming languages: Lisp, ML, C, C++, Smalltalk, and Java. Together, these languages contain most of the important language features that have been invented since higher-level programming languages emerged from the primordial swamp of assembly language programming around The history of modern programming languages begins around with the development of Algol, Cobol, Fortran, and Lisp. The main body of this book

11 1.3 Programming Language History 7 covers Lisp, with a shorter discussion of Algol and subsequent related languages. A brief account of some earlier languages is given here for those who may be curious about programming language prehistory. In the 1950s, a number of languages were developed to simplify the process of writing sequences of computer instructions. In this decade, computers were very primitive by modern standards. Most programming was done with the native machine language of the underlying hardware. This was acceptable because programs were small and efficiency was extremely important. The two most important programming language developments of the 1950s were Fortan and Cobol. Fortran was developed at IBM around by a team led by John Backus. The main innovation of Fortran (a contraction of formula translator) was that it became possible to use ordinary mathematical notation in expressions. For example, the Fortran expression for adding the value of i to twice the value of j is i+2 j. Before the development of Fortran, it might have been necessary to place i in a register, place j in a register, multiply j times 2 and then add the result to i. Fortran allowed programmers to think more naturally about numerical calculation by using symbolic names for variables and leaving some details of evaluation order to the compiler. Fortran also had subroutines (a form of procedure or function), arrays, formatted input and output, and declarations that gave programmers explicit control over the placement of variables and arrays in memory. However, that was about it. To give you some idea of the limitations of Fortran, many early Fortran compilers stored numbers 1, 2, 3... in memory locations, and programmers could change the values of numbers if they were not careful! In addition, it was not possible for a Fortran subroutine to call itself, as this required memory management techniques that had not been invented yet (see Chapter 7). Cobol is a programming language designed for business applications. Like Fortran programs, many Cobol programs are still in use today, although current versions of Fortran and Cobol differ substantially from forms of these languages of the 1950s. The primary designer of Cobol was Grace Murray Hopper, an important computer pioneer. The syntax of Cobol was intended to resemble that of common English. It has been suggested in jest that if object-oriented Cobol were a standard today, we would use add 1 to Cobol giving Cobol instead of C++. The earliest languages covered in any detail in this book are Lisp and Algol, which both came out around These languages have stack memory management and recursive functions or procedures. Lisp provides higher-order functions (still not available in many current languages) and garbage collection, whereas the Algol family of languages provides better type systems and data structuring. The main innovations of the 1970s were methods for organizing data, such as records (or structs), abstract data types, and early forms of objects. Objects became mainstream in the 1980s, and the 1990s brought increasing interest in network-centric computing, interoperability, and security and correctness issues associated with active content on the Internet. The 21 st century promises greater diversity of computing devices, cheaper and more powerful hardware, and increasing interest in correctness, security, and interoperability.

12 8 Introduction 1.4 ORGANIZATION: CONCEPTS AND LANGUAGES There are many important language concepts and many programming languages. The most natural way to summarize the field is to use a two-dimensional matrix, with languages along one axis and concepts along the other. Here is a partial sketch of such a matrix: Heap Language Expressions Functions storage Exceptions Modules Objects Threads Lisp x x x C x x x Algol 60 x x Algol 68 x x x x Pascal x x x Modula-2 x x x x Modula-3 x x x x x x ML x x x x x Simula x x x x x Smalltalk x x x x x x C++ x x x x x x Objective x x x x C Java x x x x x x x Although this matrix lists only a fraction of the languages and concepts that might be covered in a basic text or course on the programming languages, one general characteristic should be clear. There are some basic language concepts, such as expressions, functions, local variables, and stack storage allocation that are present in many languages. For these concepts, it makes more sense to discuss the concept in general than to go through a long list of similar languages. On the other hand, for concepts such as objects and threads, there are relatively few languages that exhibit these concepts in interesting ways. Therefore, we can study most of the interesting aspects of objects by comparing a few languages. Another factor that is not clear from the matrix is that, for some concepts, there is considerable variation from language to language. For example, it is more interesting to compare the way objects have been integrated into languages than it is to compare integer expressions. This is another reason why competing object-oriented languages are compared, but basic concepts related to expressions, statements, functions, and so on, are covered only once, in a concept-oriented way. Most courses and texts on programming languages use some combination of language-based and concept-based presentation. In this book a concept-oriented organization is followed for most concepts, with a language-based organization used to compare object-oriented features. The text is divided into four parts: Part 1: Functions and Foundations (Chapters 1 4) Part 2: Procedures, Types, Memory Management, and Control (5 8) Part 3: Modularity, Abstraction and Object-Oriented Programming (9 13)

13 1.4 Organization: Concepts and Languages 9 Part 4: Concurrency and Logic Programming (14 and 15) In Part 1 a short study of Lisp is presented, followed by a discussion of compiler structure, parsing, lambda calculus, and denotational semantics. A short chapter provides a brief discussion of computability and the limits of compile-time program analysis and optimization. For C programmers, the discussion of Lisp should provide a good chance to think differently about programming and programming languages. In Part 2, we progress through the main concepts associated with the conventional languages that are descended in some way from the Algol family. These concepts include type systems and type checking, functions and stack storage allocation, and control mechanisms such as exceptions and continuations. After some of the history of the Algol family of languages is summarized, the ML programming language is used as the main example, with some discussion and comparisons using C syntax. Part 3 is an investigation of program-structuring mechanisms. The important language advances of the 1970s were abstract data types and program modules. In the late 1980s, object-oriented concepts attained widespread acceptance. Because objectoriented programming is currently the most prominent programming paradigm, in most of Part 3 we focus on object-oriented concepts and languages, comparing Smalltalk, C++, and Java. Part 4 contains chapters on language mechanisms for concurrent and distributed programs and on logic programming. Because of space limitations, a number of interesting topics are not covered. Although scripting languages and other special-purpose languages are not covered explicitly in detail, an attempt has been made to integrate some relevant language concepts into the exercises.

Lecture 1: Introduction

Lecture 1: Introduction Programming Languages Lecture 1: Introduction Benjamin J. Keller Department of Computer Science, Virginia Tech Programming Languages Lecture 1 Introduction 2 Lecture Outline Preview History of Programming

More information

Programming Languages

Programming Languages Programming Languages Qing Yi Course web site: www.cs.utsa.edu/~qingyi/cs3723 cs3723 1 A little about myself Qing Yi Ph.D. Rice University, USA. Assistant Professor, Department of Computer Science Office:

More information

Workbook. First Certificate. Direct. Mary Spratt Bob Obee

Workbook. First Certificate. Direct. Mary Spratt Bob Obee Workbook First Certificate Direct Mary Spratt Bob Obee PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom CAMBRIDGE UNIVERSITY

More information

Happiness and Education. NEL NODDINGS Stanford University

Happiness and Education. NEL NODDINGS Stanford University Happiness and Education NEL NODDINGS Stanford University PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom CAMBRIDGE UNIVERSITY

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages Course Organization Introduction CSE 307: Principles of Programming Languages Spring 2015 R. Sekar Course Organization Introduction 1 / 34 Topics 1. Course Organization Info and Support Course Description

More information

CSC 272 - Software II: Principles of Programming Languages

CSC 272 - Software II: Principles of Programming Languages CSC 272 - Software II: Principles of Programming Languages Lecture 1 - An Introduction What is a Programming Language? A programming language is a notational system for describing computation in machine-readable

More information

Teacher s Book Gareth Knight Mark O Neil

Teacher s Book Gareth Knight Mark O Neil Business Explorer 3 Teacher s Book Gareth Knight Mark O Neil PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom CAMBRIDGE UNIVERSITY

More information

Chapter 1. Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705. CS-4337 Organization of Programming Languages

Chapter 1. Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705. CS-4337 Organization of Programming Languages Chapter 1 CS-4337 Organization of Programming Languages Dr. Chris Irwin Davis Email: cid021000@utdallas.edu Phone: (972) 883-3574 Office: ECSS 4.705 Chapter 1 Topics Reasons for Studying Concepts of Programming

More information

English Phrasal Verbs

English Phrasal Verbs English Phrasal Verbs 70 units of vocabulary reference and practice Self-study and classroom use Michael McCarthy Felicity O'Dell PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt

More information

Cambridge IELTS 3. Examination papers from the University of Cambridge Local Examinations Syndicate

Cambridge IELTS 3. Examination papers from the University of Cambridge Local Examinations Syndicate Cambridge IELTS 3 Examination papers from the University of Cambridge Local Examinations Syndicate PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street,

More information

Parameter passing in LISP

Parameter passing in LISP Parameter passing in LISP The actual parameters in a function call are always expressions, represented as lists structures. LISP provides two main methods of parameter passing: Pass/Call-by-value. The

More information

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming Java has become enormously popular. Java s rapid rise and wide acceptance can be traced to its design

More information

1/20/2016 INTRODUCTION

1/20/2016 INTRODUCTION INTRODUCTION 1 Programming languages have common concepts that are seen in all languages This course will discuss and illustrate these common concepts: Syntax Names Types Semantics Memory Management We

More information

Semester Review. CSC 301, Fall 2015

Semester Review. CSC 301, Fall 2015 Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!

More information

Programming Language Pragmatics

Programming Language Pragmatics Programming Language Pragmatics THIRD EDITION Michael L. Scott Department of Computer Science University of Rochester ^ШШШШШ AMSTERDAM BOSTON HEIDELBERG LONDON, '-*i» ЩЛ< ^ ' m H NEW YORK «OXFORD «PARIS»SAN

More information

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages ICOM 4036 Programming Languages Preliminaries Dr. Amirhossein Chinaei Dept. of Electrical & Computer Engineering UPRM Spring 2010 Language Evaluation Criteria Readability: the ease with which programs

More information

Chapter 6: Programming Languages

Chapter 6: Programming Languages Chapter 6: Programming Languages Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Chapter 6: Programming Languages 6.1 Historical Perspective

More information

Chapter 5 Names, Bindings, Type Checking, and Scopes

Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named

More information

Functional Programming

Functional Programming FP 2005 1.1 3 Functional Programming WOLFRAM KAHL kahl@mcmaster.ca Department of Computing and Software McMaster University FP 2005 1.2 4 What Kinds of Programming Languages are There? Imperative telling

More information

What is a programming language?

What is a programming language? Overview Introduction Motivation Why study programming languages? Some key concepts What is a programming language? Artificial language" Computers" Programs" Syntax" Semantics" What is a programming language?...there

More information

Asogwa Tochukwu Chijindu Department of Computer Engineering, Enugu State University of Science and Technology(ESUT), Enugu, Nigeria.

Asogwa Tochukwu Chijindu Department of Computer Engineering, Enugu State University of Science and Technology(ESUT), Enugu, Nigeria. Evolutionary Trend In The Development Of Computer Programming Languages And Concepts Dr.Onu Fergus.U. Department of Computer Science, Ebonyi State University, Abakaliki, Nigeria. Asogwa Tochukwu Chijindu

More information

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper Parsing Technology and its role in Legacy Modernization A Metaware White Paper 1 INTRODUCTION In the two last decades there has been an explosion of interest in software tools that can automate key tasks

More information

Quotes from Object-Oriented Software Construction

Quotes from Object-Oriented Software Construction Quotes from Object-Oriented Software Construction Bertrand Meyer Prentice-Hall, 1988 Preface, p. xiv We study the object-oriented approach as a set of principles, methods and tools which can be instrumental

More information

McGraw-Hill The McGraw-Hill Companies, Inc., 20 1. 01 0

McGraw-Hill The McGraw-Hill Companies, Inc., 20 1. 01 0 1.1 McGraw-Hill The McGraw-Hill Companies, Inc., 2000 Objectives: To describe the evolution of programming languages from machine language to high-level languages. To understand how a program in a high-level

More information

Principles of Programming Languages Topic: Introduction Professor Louis Steinberg

Principles of Programming Languages Topic: Introduction Professor Louis Steinberg Principles of Programming Languages Topic: Introduction Professor Louis Steinberg CS 314, LS,LTM: L1: Introduction 1 Contacts Prof. Louis Steinberg lou @ cs.rutgers.edu x5-3581 401 Hill TA: to be announced

More information

Fast analytical techniques for electrical and electronic circuits. Jet Propulsion Laboratory California Institute of Technology

Fast analytical techniques for electrical and electronic circuits. Jet Propulsion Laboratory California Institute of Technology Fast analytical techniques for electrical and electronic circuits Vatché Vorpérian Jet Propulsion Laboratory California Institute of Technology PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE

More information

CSCI 3136 Principles of Programming Languages

CSCI 3136 Principles of Programming Languages CSCI 3136 Principles of Programming Languages Faculty of Computer Science Dalhousie University Winter 2013 CSCI 3136 Principles of Programming Languages Faculty of Computer Science Dalhousie University

More information

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser) High-Level Programming Languages Nell Dale & John Lewis (adaptation by Michael Goldwasser) Low-Level Languages What are disadvantages of low-level languages? (e.g., machine code or assembly code) Programming

More information

Announcements FORTRAN ALGOL COBOL. Simula & Smalltalk. Programming Languages

Announcements FORTRAN ALGOL COBOL. Simula & Smalltalk. Programming Languages Announcements Programming Languages! Monday evening GBA section has been shut down " If you were assigned to this section, please find a different section " If you cannot attend a different section, please

More information

Speaking Extra. A resource book of multi-level skills activities. Mick Gammidge

Speaking Extra. A resource book of multi-level skills activities. Mick Gammidge Speaking Extra A resource book of multi-level skills activities Mick Gammidge PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom

More information

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio. Organization of Programming Languages CS320/520N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Names, Bindings, and Scopes A name is a symbolic identifier used

More information

Chapter 13 Computer Programs and Programming Languages. Discovering Computers 2012. Your Interactive Guide to the Digital World

Chapter 13 Computer Programs and Programming Languages. Discovering Computers 2012. Your Interactive Guide to the Digital World Chapter 13 Computer Programs and Programming Languages Discovering Computers 2012 Your Interactive Guide to the Digital World Objectives Overview Differentiate between machine and assembly languages Identify

More information

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction ATSBA: Advanced Technologies Supporting Business Areas Programming with Java 1 Overview and Introduction 1 1 Overview and Introduction 1 Overview and Introduction 1.1 Programming and Programming Languages

More information

Programming Languages in a Liberal Arts Education

Programming Languages in a Liberal Arts Education Programming Languages in a Liberal Arts Education Kim Bruce Computer Science Department Pomona College Claremont, CA 91711 Stephen N. Freund Computer Science Department Williams College Williamstown, MA

More information

Do general-purpose programming languages have a future?

Do general-purpose programming languages have a future? Do general-purpose programming languages have a future? Bjarne Stroustrup Texas A&M University (and AT&T Research) http://www.research.att.com/~bs Abstract As the computing world matures, the roles of

More information

Telephoning in English

Telephoning in English Telephoning in English Third edition B. Jean Naterop Rod Revell PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom CAMBRIDGE

More information

Programming Languages

Programming Languages CS 345 Programming Languages Vitaly Shmatikov http://www.cs.utexas.edu/~shmat/courses/cs345/ slide 1 Course Personnel Instructor: Vitaly Shmatikov Office: CSA 1.114 Office hours: Tuesday, 3:30-4:30pm (after

More information

CSE 130 Programming Language Principles & Paradigms

CSE 130 Programming Language Principles & Paradigms CSE 130 Programming Language Principles & Paradigms Thomas A. Powell tpowell@pint.com Housekeeping Syllabus review Direct class page link http://www.pint.com/classes/cse130 Updated syllabus, notes, homework

More information

Evolution of the Major Programming Languages

Evolution of the Major Programming Languages 142 Evolution of the Major Programming Languages Object Oriented Programming: Smalltalk Object-Oriented: It s fundamental characteristics are: Data abstraction, Inheritance and Dynamic Binding. The essence

More information

International Examinations. IGCSE Accounting Catherine Coucom

International Examinations. IGCSE Accounting Catherine Coucom International Examinations IGCSE Accounting Catherine Coucom PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street, Cambridge, United Kingdom CAMBRIDGE UNIVERSITY

More information

Symbolism and Regime Change in Russia

Symbolism and Regime Change in Russia Symbolism and Regime Change in Russia During the Soviet period, political symbolism developed into a coherent narrative that underpinned Soviet political development. Following the collapse of the Soviet

More information

Grammar, Gesture, and Meaning in American Sign Language

Grammar, Gesture, and Meaning in American Sign Language Grammar, Gesture, and Meaning in American Sign Language Scott K. Liddell Department of Linguistics and Interpretation Gallaudet University Washington, DC PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY

More information

a new anthropology of islam

a new anthropology of islam a new anthropology of islam In this powerful, but accessible, new study, draws on a full range of work in social anthropology to present Islam in ways that emphasize its constitutive practices, from praying

More information

1.1 WHAT IS A PROGRAMMING LANGUAGE?

1.1 WHAT IS A PROGRAMMING LANGUAGE? 1 INTRODUCTION 1.1 What is a Programming Language? 1.2 Abstractions in Programming Languages 1.3 Computational Paradigms 1.4 Language Definition 1.5 Language Translation 1.6 Language Design How we communicate

More information

On the (un)suitability of Java to be the first programming language

On the (un)suitability of Java to be the first programming language On the (un)suitability of Java to be the first programming language Mirjana Ivanovic Faculty of Science, Department of Mathematics and Informatics Trg Dositeja Obradovica 4, Novi Sad mira @im.ns.ac.yu

More information

Cambridge IELTS 2. Examination papers from the University of Cambridge Local Examinations Syndicate

Cambridge IELTS 2. Examination papers from the University of Cambridge Local Examinations Syndicate Cambridge IELTS 2 Examination papers from the University of Cambridge Local Examinations Syndicate PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building, Trumpington Street,

More information

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm

More information

The Design of the Inferno Virtual Machine. Introduction

The Design of the Inferno Virtual Machine. Introduction The Design of the Inferno Virtual Machine Phil Winterbottom Rob Pike Bell Labs, Lucent Technologies {philw, rob}@plan9.bell-labs.com http://www.lucent.com/inferno Introduction Virtual Machine are topical

More information

The Fastest Way to Parallel Programming for Multicore, Clusters, Supercomputers and the Cloud.

The Fastest Way to Parallel Programming for Multicore, Clusters, Supercomputers and the Cloud. White Paper 021313-3 Page 1 : A Software Framework for Parallel Programming* The Fastest Way to Parallel Programming for Multicore, Clusters, Supercomputers and the Cloud. ABSTRACT Programming for Multicore,

More information

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014 CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages Nicki Dell Spring 2014 What is a Programming Language? A set of symbols and associated tools that translate (if necessary) collections

More information

Structure of Presentation. The Role of Programming in Informatics Curricula. Concepts of Informatics 2. Concepts of Informatics 1

Structure of Presentation. The Role of Programming in Informatics Curricula. Concepts of Informatics 2. Concepts of Informatics 1 The Role of Programming in Informatics Curricula A. J. Cowling Department of Computer Science University of Sheffield Structure of Presentation Introduction The problem, and the key concepts. Dimensions

More information

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program

More information

Concepts of Programming Languages: A Unified Approach. Karl Abrahamson

Concepts of Programming Languages: A Unified Approach. Karl Abrahamson Concepts of Programming Languages: A Unified Approach Karl Abrahamson August 2013 2 Copyright (c) 2013 Karl Abrahamson. Contents 1 Introduction to Programming Languages 11 1.1 Programming languages.............................

More information

Fundamentals of Programming Languages

Fundamentals of Programming Languages A puzzle and a dilemma Suppose I want to capture/catch/slay crashing programs before they have a chance to run (=static type safety). Do I let this one go? let c = ref (fun x -> x) in c := (fun x -> x

More information

Introduction to Software Paradigms & Procedural Programming Paradigm

Introduction to Software Paradigms & Procedural Programming Paradigm Introduction & Procedural Programming Sample Courseware Introduction to Software Paradigms & Procedural Programming Paradigm This Lesson introduces main terminology to be used in the whole course. Thus,

More information

www.iacpe.com Knowledge, Certification, Networking

www.iacpe.com Knowledge, Certification, Networking www.iacpe.com Knowledge, Certification, Networking Page : 1 of 95 Rev. 01- Feb 2016 IACPE No 19, Jalan Bilal Mahmood 80100 Johor Bahru Malaysia Introduction to Software Engineering The International of

More information

Programming Language Concepts for Software Developers

Programming Language Concepts for Software Developers Programming Language Concepts for Software Developers Peter Sestoft IT University of Copenhagen, Denmark sestoft@itu.dk Abstract This note describes and motivates our current plans for an undergraduate

More information

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Functional Programming. Functional Programming Languages. Chapter 14. Introduction Functional Programming Languages Chapter 14 Introduction Functional programming paradigm History Features and concepts Examples: Lisp ML 1 2 Functional Programming Functional Programming Languages The

More information

BCS Higher Education Qualifications. Professional Graduate Diploma in IT. Programming Paradigms Syllabus

BCS Higher Education Qualifications. Professional Graduate Diploma in IT. Programming Paradigms Syllabus BCS Higher Education Qualifications Professional Graduate Diploma in IT Programming Paradigms Syllabus Version: 180516 Contents 1. Change History 3 2. Rationale 3 3. Aims 3 4. Objectives 3 5. Prior Knowledge

More information

Object-Oriented Software Specification in Programming Language Design and Implementation

Object-Oriented Software Specification in Programming Language Design and Implementation Object-Oriented Software Specification in Programming Language Design and Implementation Barrett R. Bryant and Viswanathan Vaidyanathan Department of Computer and Information Sciences University of Alabama

More information

Programming Languages

Programming Languages Programming Languages Programming languages bridge the gap between people and machines; for that matter, they also bridge the gap among people who would like to share algorithms in a way that immediately

More information

Stack Allocation. Run-Time Data Structures. Static Structures

Stack Allocation. Run-Time Data Structures. Static Structures Run-Time Data Structures Stack Allocation Static Structures For static structures, a fixed address is used throughout execution. This is the oldest and simplest memory organization. In current compilers,

More information

C# and Other Languages

C# and Other Languages C# and Other Languages Rob Miles Department of Computer Science Why do we have lots of Programming Languages? Different developer audiences Different application areas/target platforms Graphics, AI, List

More information

Manage Software Development in LabVIEW with Professional Tools

Manage Software Development in LabVIEW with Professional Tools Manage Software Development in LabVIEW with Professional Tools Introduction For many years, National Instruments LabVIEW software has been known as an easy-to-use development tool for building data acquisition

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

Chapter 4: Tools of Modern Systems Analysis

Chapter 4: Tools of Modern Systems Analysis Just Enough Structured Analysis Chapter 4: Tools of Modern Systems Analysis Nature has... some sort of arithmetical-geometrical coordinate system, because nature has all kinds of models. What we experience

More information

Introduction to Python

Introduction to Python 1 Daniel Lucio March 2016 Creator of Python https://en.wikipedia.org/wiki/guido_van_rossum 2 Python Timeline Implementation Started v1.0 v1.6 v2.1 v2.3 v2.5 v3.0 v3.1 v3.2 v3.4 1980 1991 1997 2004 2010

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

Lab Experience 17. Programming Language Translation

Lab Experience 17. Programming Language Translation Lab Experience 17 Programming Language Translation Objectives Gain insight into the translation process for converting one virtual machine to another See the process by which an assembler translates assembly

More information

Building Applications Using Micro Focus COBOL

Building Applications Using Micro Focus COBOL Building Applications Using Micro Focus COBOL Abstract If you look through the Micro Focus COBOL documentation, you will see many different executable file types referenced: int, gnt, exe, dll and others.

More information

Programming language concepts

Programming language concepts Programming language concepts Third edition Carlo Ghezzi, Politecnico di Milano Mehdi Jazayeri, Technische Universität Wien John Wiley & Sons New York Chichester Brisbane Toronto Singapore 2 Chap. Copyright

More information

Parameter Passing in Pascal

Parameter Passing in Pascal Parameter Passing in Pascal Mordechai Ben-Ari Department of Science Teaching Weizmann Institute of Science Rehovot 76100 Israel ntbenari@wis.weizmann.ac.il Abstract This paper claims that reference parameters

More information

English Idioms. 60 units of vocabulary reference and practice Self-study and classroom use. Michael McCarthy Felicity O'Dell

English Idioms. 60 units of vocabulary reference and practice Self-study and classroom use. Michael McCarthy Felicity O'Dell English Idioms 60 units of vocabulary reference and practice Self-study and classroom use Michael McCarthy Felicity O'Dell PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE The Pitt Building,

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine

More information

BLM 413E - Parallel Programming Lecture 3

BLM 413E - Parallel Programming Lecture 3 BLM 413E - Parallel Programming Lecture 3 FSMVU Bilgisayar Mühendisliği Öğr. Gör. Musa AYDIN 14.10.2015 2015-2016 M.A. 1 Parallel Programming Models Parallel Programming Models Overview There are several

More information

On Understanding Types, Data Abstraction, and Polymorphism

On Understanding Types, Data Abstraction, and Polymorphism 1 Computing Surveys, Vol 17 n. 4, pp 471-522, December 1985 On Understanding Types, Data Abstraction, and Polymorphism Luca Cardelli AT&T Bell Laboratories, Murray Hill, NJ 07974 (current address: DEC

More information

Semantic Analysis: Types and Type Checking

Semantic Analysis: Types and Type Checking Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors

More information

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating

More information

Fundamentals of Java Programming

Fundamentals of Java Programming Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors

More information

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont. Objectives To describe the services an operating system provides to users, processes, and other systems To discuss the various ways of structuring an operating system Chapter 2: Operating-System Structures

More information

Algorithms, Flowcharts & Program Design. ComPro

Algorithms, Flowcharts & Program Design. ComPro Algorithms, Flowcharts & Program Design ComPro Definition Algorithm: o sequence of steps to be performed in order to solve a problem by the computer. Flowchart: o graphical or symbolic representation of

More information

Chapter 12 Programming Concepts and Languages

Chapter 12 Programming Concepts and Languages Chapter 12 Programming Concepts and Languages Chapter 12 Programming Concepts and Languages Paradigm Publishing, Inc. 12-1 Presentation Overview Programming Concepts Problem-Solving Techniques The Evolution

More information

THE OPEN UNIVERSITY OF TANZANIA

THE OPEN UNIVERSITY OF TANZANIA THE OPEN UNIVERSITY OF TANZANIA FACULTY OF SCIENCE, TECHNOLOGY AND ENVIRONMENTAL STUDIES ODM 103: INTRODUCTION TO COMPUTER PROGRAMMING LANGUAGES Said Ally i ODM 103 INTRODUCTION TO COMPUTER PROGRAMMING

More information

1 Idioms, Patterns, and Programming

1 Idioms, Patterns, and Programming 1 Idioms, Patterns, and Programming Chapter Objectives Chapter Contents This chapter introduces the ideas that we use to organize our thinking about languages and how they shape the design and implementation

More information

ML for the Working Programmer

ML for the Working Programmer ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

More information

On Understanding Types, Data Abstraction, and Polymorphism

On Understanding Types, Data Abstraction, and Polymorphism On Understanding Types, Data Abstraction, and Polymorphism LUCA CARDELLI AT&T Bell Laboratories, Murray Hill, N. J. 07974 PETER WEGNER Department of Computer Science, Brown University, Providence, R. I.

More information

Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm

Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm Software Paradigms (Lesson 1) Introduction & Procedural Programming Paradigm Table of Contents 1 Introduction... 2 1.1 Programming Paradigm... 2 1.2 Software Design Paradigm... 3 1.2.1 Design Patterns...

More information

Course Goal CMSC 330: Organization of Programming Languages. Studying Programming Languages. All Languages Are (Kind of) Equivalent.

Course Goal CMSC 330: Organization of Programming Languages. Studying Programming Languages. All Languages Are (Kind of) Equivalent. Course Goal CMSC 330: Organization of Programming Languages Introduction Instructors: Michael Hicks and Anwar Mamat Learn how programming languages work Broaden your language horizons Different programming

More information

Switching and Finite Automata Theory

Switching and Finite Automata Theory Switching and Finite Automata Theory Understand the structure, behavior, and limitations of logic machines with this thoroughly updated third edition. New topics include: CMOS gates logic synthesis logic

More information

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved.

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Competencies (Page 1 of 2) Describe the six steps of programming Discuss design

More information

Programming Languages & Tools

Programming Languages & Tools 4 Programming Languages & Tools Almost any programming language one is familiar with can be used for computational work (despite the fact that some people believe strongly that their own favorite programming

More information

1. Overview of the Java Language

1. Overview of the Java Language 1. Overview of the Java Language What Is the Java Technology? Java technology is: A programming language A development environment An application environment A deployment environment It is similar in syntax

More information

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008 An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008 Computer Science the study of algorithms, including Their formal and mathematical properties Their hardware realizations

More information

Levels of Programming Languages. Gerald Penn CSC 324

Levels of Programming Languages. Gerald Penn CSC 324 Levels of Programming Languages Gerald Penn CSC 324 Levels of Programming Language Microcode Machine code Assembly Language Low-level Programming Language High-level Programming Language Levels of Programming

More information

programming languages, programming language standards and compiler validation

programming languages, programming language standards and compiler validation Software Quality Issues when choosing a Programming Language C.J.Burgess Department of Computer Science, University of Bristol, Bristol, BS8 1TR, England Abstract For high quality software, an important

More information

Understanding Programming Languages

Understanding Programming Languages Understanding Programming Languages M. Ben-Ari Weizmann Institute of Science Originally published by John Wiley & Sons, Chichester, 1996. Copyright c 2006 by M. Ben-Ari. You may download, display and print

More information

Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer

Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer Lecture 10: Static Semantics Overview 1 Lexical analysis Produces tokens Detects & eliminates illegal tokens Parsing Produces trees Detects & eliminates ill-formed parse trees Static semantic analysis

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

More information