Programming Languages
HTML Edition
Version 1.02

Mike Grant
Scott Smith
  http://www.cs.jhu.edu/~scott/plbook

Copyright © 2002-2005 Scott F. Smith. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

This document was last compiled on March 3, 2005.

Contents
GNU Free Documentation License
 Preamble
 Applicability and Definitions
 Verbatim Copying
 Copying in Quantity
 Modifications
 Combining Documents
 Collections of Documents
 Aggregation With Independent Works
 Translation
 Termination
 Future Revisions of This License
 ADDENDUM: How to use this License for your documents
Preface
 The OCaml Language
 The DDK
 Background Needed
1 Introduction
 1.1 The Pre-History of Programming Languages
 1.2 A Brief Early History of Languages
 1.3 This Book
2 Operational Semantics
 2.1 A First Look at Operational Semantics
 2.2 BNF grammars and Syntax
 2.3 The D Programming Language
 2.4 Operational Equivalence
3 Tuples, Records, and Variants
 3.1 Tuples
 3.2 Records
 3.3 Variants
4 Side Effects: State and Exceptions
 4.1 State
 4.2 Environment-Based Interpreters
 4.3 The DSR Language
 4.4 Exceptions and Other Control Operations
5 Object-Oriented Language Features
 5.1 Encoding Objects in DSR
 5.2 The DOB Language
6 Type Systems
 6.1 An Overview of Types
 6.2 TD: A Typed D Variation
 6.3 Type Checking
 6.4 Types for an Advanced Language: TDSRX
 6.5 Subtyping
 6.6 Type Inference and Polymorphism
 6.7 Constrained Type Inference
7 Compilation by Program Transformation
 7.1 Closure Conversion
 7.2 A-Translation
 7.3 Function Hoisting
 7.4 Translation to C
 7.5 Summary
 7.6 Optimization
 7.7 Garbage Collection
A DDK: The D Development Kit
 A.1 Installing the DDK
 A.2 Using D and DSR
 A.3 The DDK Source Code
Bibliography
Index