OnDoc
| sign
in
up
~
pub
|
pdf
txt
html
toc
url
|
<<
>>
1
2
3
4
5
6
7
8
~
376
Table of Contents
Preface
Acknowledgments
I Prelude
Modeling Languages
Modeling Meaning
Modeling Syntax
A Primer on Parsers
Primus Inter Parsers
II Rudimentary Interpreters
Interpreting Arithmetic
Substitution
Defining Substitution
Calculating with with
The Scope of with Expressions
What Kind of Redundancy do Identifiers Eliminate?
Are Names Necessary?
An Introduction to Functions
Enriching the Language with Functions
The Scope of Substitution
The Scope of Function Definitions
Deferring Substitution
The Substitution Repository
Deferring Substitution Correctly
Fixing the Interpreter
First-Class Functions
A Taxonomy of Functions
Enriching the Language with Functions
Making with Redundant
Implementing Functions using Deferred Substitutions
Some Perspective on Scope
Filtering and Sorting Lists
Differentiation
Callbacks
Eagerness and Laziness
Standardizing Terminology
III Laziness
Programming with Laziness
Haskell
Expressions and Definitions
Lists
Polymorphic Type Inference
Laziness
An Interpreter
Shell Scripting
Implementing Laziness
Implementing Laziness
Caching Computation
Caching Computations Safely
Scope and Evaluation Regimes
IV Recursion
Understanding Recursion
A Recursion Construct
Environments for Recursion
An Environmental Hazard
Implementing Recursion
V Intermezzo
Representation Choices
Representing Environments
Representing Numbers
Representing Functions
Types of Interpreters
Procedural Representation of Recursive Environments
VI State
Church and State
Mutable Data Structures
Implementation Constraints
Insight
An Interpreter for Mutable Boxes
The Evaluation Pattern
The Interpreter
Scope versus Extent
Variables
Implementing Variables
Interaction Between Variables and Function Application
Perspective
VII Continuations
Some Problems with Web Programs
The Structure of Web Programs
Explicating the Pending Computation
A Better Server Primitive
Testing Web Transformations
Executing Programs on a Traditional Server
More Web Transformation
Transforming Library and Recursive Code
Transforming Multiple Procedures
Transforming State
The Essence of the Transformation
Transforming Higher-Order Procedures
Perspective on the Web Transformation
Conversion into Continuation-Passing Style
The Transformation, Informally
The Transformation, Formally
Testing
Programming with Continuations
Capturing Continuations
Escapers
Exceptions
Web Programming
Producers and Consumers
A Better Producer
Why Continuations Matter
Implementing Continuations
Representing Continuations
Adding Continuations to the Language
On Stacks
Tail Calls
Testing
VIII Memory Management
Automatic Memory Management
Motivation
Truth and Provability
IX Semantics
Shrinking the Language
Encoding Lists
Encoding Boolean Constants and Operations
Encoding Numbers and Arithmetic
Eliminating Recursion
Semantics
X Types
Introduction
What Are Types?
Type System Design Forces
Why Types?
Type Judgments
What They Are
How Type Judgments Work
Typing Control
Conditionals
Recursion
Termination
Typed Recursive Programming
Typing Data
Recursive Types
Declaring Recursive Types
Judgments for Recursive Types
Space for Datatype Variant Tags
Type Soundness
Explicit Polymorphism
Motivation
Solution
The Type Language
Evaluation Semantics and Efficiency
Perspective
Type Inference
Inferring Types
Example: Factorial
Example: Numeric-List Length
Formalizing Constraint Generation
Errors
Example: Using First-Class Functions
Solving Type Constraints
The Unification Algorithm
Example of Unification at Work
Parameterized Types
The ``Occurs'' Check
Underconstrained Systems
Principal Types
Implicit Polymorphism
The Problem
A Solution
A Better Solution
Recursion
A Significant Subtlety
Why Let and not Lambda?
The Structure of ML Programs
Interaction with Effects
XI Programming by Searching
Introduction
Programming in Prolog
Example: Academic Family Trees
Intermission
Example: Encoding Type Judgments
Final Credits
Implementing Prolog
Implementation
Searching
Satisfaction
Matching with Logic Variables
Subtleties and Compromises
Future Directions
XII Domain-Specific Languages and Metaprogramming
Domain-Specific Languages
Language Design Variables
Languages as Abstractions
Domain-Specific Languages
Macros as Compilers
Language Reuse
Example: Measuring Time
Example: Local Definitions
Example: Nested Local Definitions
Example: Simple Conditional
Example: Disjunction
Hygiene
More Macrology by Example
Loops with Named Iteration Identifiers
Overriding Hygiene: Loops with Implicit Iteration Identifiers
Combining the Pieces: A Loop for All Seasons
Comparison to Macros in C
Abuses of Macros
Uses of Macros
Macros and their Impact on Language Design
Language Design Philosophy
Example: Pattern Matching
Example: Automata
Concision
Efficiency
Other Uses
Perspective
XIII What's Next?
Programming Interactive Systems
What Else is Next