Foundations Of Programming Languages Unknown download
Foundations Of Programming Languages Unknown download
download
https://ebookbell.com/product/foundations-of-programming-
languages-unknown-32843774
https://ebookbell.com/product/foundations-of-programming-
languages-1st-edition-kent-d-lee-4973620
https://ebookbell.com/product/foundations-of-programming-languages-
kent-d-lee-6804898
https://ebookbell.com/product/foundations-of-programming-languages-
lecture-notes-cmu-15312-itebooks-23836458
https://ebookbell.com/product/foundations-of-programming-
languages-2nd-edition-kent-d-lee-216857622
Foundations Of Probabilistic Logic Programming Languages Semantics
Inference And Learning 2nd Edition Fabrizio Riguzzi
https://ebookbell.com/product/foundations-of-probabilistic-logic-
programming-languages-semantics-inference-and-learning-2nd-edition-
fabrizio-riguzzi-50378238
https://ebookbell.com/product/foundations-of-probabilistic-logic-
programming-languages-semantics-inference-and-learning-fabrizio-
riguzzi-10467928
https://ebookbell.com/product/foundations-of-quantum-programming-
mingsheng-ying-56962912
https://ebookbell.com/product/foundations-of-quantum-programming-2nd-
edition-mingsheng-ying-57513714
https://ebookbell.com/product/foundations-of-probabilistic-
programming-alexandra-silva-joostpieter-katoen-gilles-barthe-
eds-36002630
Undergraduate Topics in Computer Science
Kent D. Lee
Foundations of
Programming
Languages
Second Edition
Undergraduate Topics in Computer
Science
Series editor
Ian Mackie
Advisory Boards
Samson Abramsky, University of Oxford, Oxford, UK
Chris Hankin, Imperial College London, London, UK
Dexter C. Kozen, Cornell University, Ithaca, USA
Andrew Pitts, University of Cambridge, Cambridge, UK
Hanne Riis Nielson, Technical University of Denmark, Kongens Lyngby, Denmark
Steven S. Skiena, Stony Brook University, Stony Brook, USA
Iain Stewart, University of Durham, Durham, UK
Undergraduate Topics in Computer Science (UTiCS) delivers high-quality
instructional content for undergraduates studying in all areas of computing and
information science. From core foundational and theoretical material to final-year
topics and applications, UTiCS books take a fresh, concise, and modern approach
and are ideal for self-study or for a one- or two-semester course. The texts are all
authored by established experts in their fields, reviewed by an international advisory
board, and contain numerous examples and problems. Many include fully worked
solutions.
Foundations
of Programming
Languages
Second Edition
123
Kent D. Lee
Luther College
Decorah, IA
USA
v
vi Preface
It is expected that most readers of this text will have had some prior experience
with object-oriented languages. JCoCo is implemented in Java (hence the J), pro-
viding a chance to learn Java in some detail and see it used in a larger software
project like the JCoCo implementation. The text proceeds in a bottom-up fashion by
implementing extensions to JCoCo using Java. Then, a full-featured functional
language called Small is implemented on top of the JCoCo virtual machine. The
Small language is a subset of Standard ML. Standard ML is first introduced in this
text and then used to implement the Small subset of the Standard ML language,
which really is not that small afterall. Finally, late in the text a type inference system
for Small is developed and implemented in Prolog. Prolog is an example of a logic
programming language.
The text is meant to be used interactively. You should read a section, and as you
read it, do the practice exercises. Each of the exercises is meant to give you a goal
in reading a section of the text.
The text Web site http://www.cs.luther.edu/*leekent/PL includes code and
other support files that may be downloaded. These include the JCoCo virtual
machine and the MLComp compiler/type inference system.
I hope you enjoy reading the text and working through the exercises and practice
problems. Have fun with it and get creative!
Acknowledgements
I have been fortunate to have good teachers throughout high school, college, and
graduate school. Ken Slonneger was my advisor in graduate school, and this book
came into being because of him. He inspired me to write a text that supports the
same teaching style he used in his classroom. I’d also like to thank Eric Manley of
Drake University for working with me by trying the projects with his students and
for the valuable feedback he provided to me during the development of this text.
Thanks, Eric.
I’m also fortunate to have good students working with me. Thanks go to
Jonathan Opdahl for his help in building the Java version of CoCo, a virtual
machine used throughout this text, and named JCoCo both because it is imple-
mented in Java and because Jonathan helped me build it. Thank you Jonathan for
your work on this project. It is greatly appreciated.
For Teachers
This book was written to fulfill two goals. The first is to introduce students to three
programming paradigms: object-oriented/imperative, functional, and logic pro-
gramming. To be ready for the content of this book, students should have some
background in an imperative language, probably an object-oriented language such
Preface vii
as Python, Java, or C++. They should have had an introductory course and a course
in data structures as a minimum. While the prepared student will have written
several programs, some of them fairly complex, most probably still struggle with
predicting exactly what their program will do. It is assumed that ideas such as
polymorphism, recursion, and logical implication are relatively new to students
reading this book. The text assumes that students have little or no experience with
the functional and logic programming paradigms.
The object-oriented language presented in this book is Java. C++ has many
nuances that are worthy of several chapters in a textbook. The first edition of this
text did cover C++ as the object-oriented language, but Java is better suited to the
JCoCo virtual machine implementation presented in this text. However, significant
topics of C++ are contrasted to Java in this text. Notably, the pass-by-value and
pass-by-reference mechanisms in C++ create considerable complexity in the lan-
guage. In addition, the ability of C++ programs to create objects both on the
run-time stack and in the heap is contrasted to Java. Of course the standard
object-oriented concepts including polymorphism and inheritance and a comparison
of templates from C++ and interfaces from Java are covered in this text.
The text uses Standard ML as the functional language. ML has a polymorphic
type inference system to statically type programs of the language. In addition, the
type inference system of ML is formally proven sound and complete. This has some
implications in writing programs. While ML’s cryptic compiler error messages are
sometimes hard to understand at first, once a program compiles it will often work
correctly the first time. That’s an amazing statement to make if your past experience
is in a dynamically typed language such as Lisp, Scheme, Ruby, or Python.
The logic language used in this text is Prolog. While Prolog has traditionally
been an Artificial Intelligence language, it originated as a metalanguage for
expressing other languages. The text concentrates on using Prolog to implement a
type inference system. Students learn about logical implication and how a problem
they are familiar with can be re-expressed in a logic programming language.
The second goal of the text is to be interactive. This book is intended to be used
in and outside of class. It is my experience that we almost all learn more by doing
than by seeing. To that end, the text encourages teachers to actively teach. Each
chapter follows a pattern of presenting a topic followed by a practice exercise or
exercises that encourage students to try what they have just read. These exercises
can be used in class to help students check their understanding of a topic. Teachers
are encouraged to take the time to present a topic and then allow students time to
reflect and practice the concept just presented. In this way, the text becomes a
lecture resource. Students get two things out of this. It forces them to be interac-
tively engaged in the lectures, not just passive observers. It also gives them
immediate feedback on key concepts to help them determine whether they under-
stand the material or not. This encourages them to ask questions when they have
difficulty with an exercise. Tell students to bring the book to class along with a
pencil and paper. The practice exercises are easily identified.
viii Preface
This book presents several projects to reinforce topics outside the classroom.
Each chapter of the text suggests several non-trivial programming projects that
accompany the paradigm being covered to drive home the concepts covered in that
chapter. The projects and exercises described in this text have been tested in
practice, and documentation and solutions are available upon request.
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Historical Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Models of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 The Imperative Model . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.2 The Functional Model . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.3 The Logic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 The Origins of a Few Programming Languages . . . . . . . . . . . . . 10
1.3.1 A Brief History of C and C++ . . . . . . . . . . . . . . . . . . . 11
1.3.2 A Brief History of Java . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.3 A Brief History of Python . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.4 A Brief History of Standard ML . . . . . . . . . . . . . . . . . . 14
1.3.5 A Brief History of Prolog . . . . . . . . . . . . . . . . . . . . . . . 16
1.4 Language Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4.1 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.4.2 Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.3 Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.5 Types and Type Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.6 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.7 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.8 Solutions to Practice Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2 Backus Naur Form (BNF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.1 BNF Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.2 Extended BNF (EBNF) . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 Context-Free Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.1 The Infix Expression Grammar . . . . . . . . . . . . . . . . . . . 35
2.4 Derivations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4.1 A Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4.2 Types of Derivations . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.3 Prefix Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.4.4 The Prefix Expression Grammar . . . . . . . . . . . . . . . . . . 36
ix
x Contents
To begin you should know something about the history of computing, particularly
as it applies to the models of computation that have been used in implementing many
of the programming languages we use today. All of what we know in Computer
Science is built on the shoulders of those who came before us. To understand where
we are, we really should know something about where we came from in terms of
Computer Science. Many great people have been involved in the development of
programming languages and to learn even a little about who these people are is
really fascinating and worthy of an entire book in itself.
exploiting properties of symmetry within the equations [8]. One Lie group, the E8
group was too complicated to map in Lie’s time. In fact, it wasn’t until 2007 that
the structure of the E8 group could be mapped because the solution produced sixty
times more data than the human genome project [1].
While the techniques Lie and Abel discovered were hard for people to learn and
use at the time, today computer programs capable of symbolic manipulation use
Lie’s techniques to solve these and other equally complicated problems. And, the
solutions of these problems are very relevant in the world today. For example, the
work of Sophus Lie is used in the design of aircraft.
As mathematicians’ problem solving techniques became more sophisticated and
the problems they were solving became more complex, they were interested in finding
automated ways of solving these problems. Charles Babbage (1791–1871) saw the
need for a computer to do calculations that were too error-prone for humans to
perform. He designed a difference engine to compute mathematical tables when he
found that human computers weren’t very accurate [27]. However, his computer was
mechanical and couldn’t be built using engineering techniques known at that time.
In fact it wasn’t completed until 1990, but it worked just as he said it would over a
hundred years earlier.
Charles Babbage’s difference engine was an early attempt at automating a solution
to a problem, but others would follow of course. Alan Turing was a British mathe-
matician and one of the first computer scientists. He lived from 1912–1954. In 1936
he wrote a paper entitled, “On Computable Numbers, with an Application to the
Entscheidungsproblem” [23]. The Entscheidungsproblem, or decision problem, had
been proposed a decade earlier by a German mathematician named David Hilbert.
This problem asks: Can an algorithm be defined that decides if a statement given in
first order logic can be proved from a set of axioms and known truth values? The
problem was later generalized to the following question: Can we come up with a
general set of steps that given any algorithm and its data, will decide if it terminates?
In Alan Turing’s paper, he devised an abstract machine called the Turing Machine.
This Turing Machine was very general and simple. It consisted of a set of states and
a tape. The set of states were decided on by a programmer. The machine starts in
the start state as decided by the programmer. From that state it could read a symbol
from a tape. Based on the symbol it could write a symbol to the tape and move to
the left or right, while transitioning to another state. As the Turing machine ran, the
action that it took was dictated by the current state and the symbol on the tape. The
programmer got to decide how many states were a part of the machine, what each
state should do, and how to move from one state to another. In Turing’s paper he
proved that such a machine could be used to solve any computable function and that
the decision problem was not solvable by this machine. The more general statement
of this problem was named the Halting Problem. This was a very important result in
the field of theoretical Computer Science.
In 1939 John Atanasoff, at Iowa State University, designed what is arguably the
first computer, the ABC or Atanasoff-Berry Computer [28]. Clifford Berry was one of
his graduate students. The computer had no central processing unit, but it did perform
logical and other mathematical operations. Eckert and Mauchly, at the University of
4 1 Introduction
Pennsylvania, were interested in building a computer during the second world war.
They were funded by the Department of Defense to build a machine to calculate
trajectory tables for launching shells from ships. The computer, called ENIAC for
Electronic Numerical Integrator and Computer, was unveiled in 1946, just after the
war had ended. ENIAC was difficult to program since the program was written by
plugging cables into a switch, similar to an old telephone switchboard.
Around that same time a new computer, called EDVAC, was being designed. In
1945 John von Neumann proposed storing the computer programs on EDVAC in
memory along with the program data [26]. Alan Turing closely followed John von
Neumann’s paper by publishing a paper of his own in 1946 describing a more com-
plete design for stored-program computers [24]. To this day the computers we build
and use are stored-program computers. The architecture is called the von Neumann
architecture because of John von Neumann’s and Alan Turing’s contributions. While
Turing didn’t get the architecture named after him, he is famous in Computer Science
for other reasons like the Turing machine and the Halting problem.
In the early days of Computer Science, many programmers were interested in
writing tools that made it easier to program computers. Much of the programming
was based on the concept of a stored-program computer and many early programming
languages were extensions of this model of computation. In the stored-program
model the program and data are stored in memory. The program manipulates data
based on some input. It then produces output.
Around 1958, Algol was created and the second revision of this language, called
Algol 60, was the first modern, structured, imperative programming language. While
the language was designed by a committee, a large part of the success of the project
was due to the contributions of John Backus pictured in Fig. 1.2. He described the
structure of the Algol language using a mathematical notation that would later be
called Backus-Naur Format or BNF. Very little has changed with the underlying
computer architecture over the years. Of course, there have been many changes in
the size, speed, and cost of computers! In addition, the languages we use have become
even more structured over the years. But, the principles that Algol 60 introduced are
still in use today.
Recalling that most early computer scientists were mathematicians, it shouldn’t
be too surprising to learn that there were others that approached the problem of
programming differently. Much of the initial interest in computers was spurred by the
invention of the stored-program computer and many of the early languages reflected
this excitement. The imperative style was closely tied to the architecture of a stored
program computer. Data was read from an input device and the program acted on
that data by updating memory as the program executed. There was another approach
developing at the same time. Back in 1936, Alonzo Church, a U.S. mathematician
who lived from 1903–1995, was also interested in the decision problem proposed
by David Hilbert. To try to solve the problem he devised a language called the
lambda calculus, usually written as the λ-calculus. Using his very simple language
he was able to describe computation as symbol manipulation. Alan Turing was a
doctoral student of Church and while they independently came up with two ways to
prove that the decision problem was not solvable, they later proved their two models
of computation, Turing machines and the λ-calculus, were equivalent. Their work
eventually led to a very important result called the Church-Turing Thesis. Informally,
the thesis states that all computable problems can be solved by a Turing Machine or
the λ-calculus. The two models are equivalent in power.
Ideas from the λ-calculus led to the development of Lisp by John McCarthy,
pictured in Fig. 1.3. The λ-calculus and Lisp were not designed based on the principle
of the stored-program computer. In contrast to Algol 60, the focus of these languages
was on functions and what could be computed using functions. Lisp was developed
around 1958, the same time that Algol 60 was being developed.
Logic is important both in Computer Science and Mathematics. Logicians were
also interested in solving problems in the early days of Computer Science. Many
problems in logic are expressed in the languages of propositional or predicate logic.
Of course, the development of logic goes all the way back to ancient Greece. Some
logicians of the 20th century were interested in understanding natural language and
they were looking for a way to use computers to solve at least some of the problems
related to processing natural language statements. The desire to use computers in
solving problems from logic led to the development of Prolog, a powerful program-
ming language based on predicate logic.
1. What are the origins of the three major computational models that early computer
scientists developed?
2. Who were Alan Turing and Alonzo Church and what were some of their contri-
butions to Computer Science?
3. What idea did both John von Neumann and Alan Turing contribute to?
4. What notation did John Backus develop and what was one of its first uses?
5. What year did Alan Turing first propose the Turing machine and why?
6. What year did Alonzo Church first propose the λ-calculus and why?
7. Why are Eckert and Mauchly famous?
8. Why are the history of Mathematics and Computer Science so closely tied
together?
While there is some controversy about who originally came up with the concept of
a stored program computer, John von Neumann is generally given credit for the idea
of storing a program as a string of 0’s and 1’s in memory along with the data used by
the program. Von Neumann’s architecture had very little structure to it. It consisted
of several registers and memory. The Program Counter (PC) register kept track of
the next instruction to execute. There were other registers that could hold a value or
point to other values stored in memory. This model of computation was useful when
programs were small. However, without additional structure, anything but a small
program would quickly get hard to manage. This was what was driving the need for
better and newer programming languages. Programmers needed tools that let them
organize their code so they could focus on problem solving instead of the details of
the hardware.
1.2 Models of Computation 7
As programs grew in size it was necessary to provide the means for applying addi-
tional structure to them. In the early days a function was often called a sub-routine.
Functions, procedures, and sub-routines were introduced by languages like Algol
60 so that programs could be decomposed into simpler sub-programs, providing
a way for programmers to organize their code. Terms like top-down or bottom-
up design were used to describe this process of subdividing programs into simpler
sub-programs. This process of subdividing programs was often called structured
programming, referring to the decomposition of programs into simpler, more man-
ageable pieces. Most modern languages provide the means to decompose problems
into simpler subproblems. We often refer to this structured approach as the imperative
model of programming.
To implement functions and function calls in the von Neumann architecture, it
was necessary to apply some organization to the data of a program. In the imperative
model, memory is divided into regions which hold the program and the data. The
data area is further subdivided into the static or global data area, the run-time stack,
and the heap as pictured in Fig. 1.4.
In the late 1970s and 1980s people like Niklaus Wirth and Bjarne Stroustrup were
interested in developing languages that supported an additional level of organization
called Object-Oriented Programming, often abbreviated OOP. Object-oriented pro-
gramming still uses the imperative model of programming. The addition of a means
to describe classes of objects gives programmers another way of organizing their
code into functions that are related to a particular type of object.
When a program executes it uses a special register called the stack pointer (SP) to
point to the top activation record on the run-time stack. The run-time stack contains
one activation record for each function or procedure invocation that is currently
unfinished in the program. The top activation record corresponds to the current
In the functional model the goal of a program is slightly different. This slight change
in the way the model works has a big influence on how you program. In the functional
model of computation the focus is on function calls. Functions and parameter passing
are the primary means of accomplishing data transformation.
Data is generally not changed in the functional model. Instead, new values are
constructed from old values. A pure functional model wouldn’t allow any updates
to existing values. However, most functional languages allow limited updates to
memory in the imperative style.
The conceptual view presented in Fig. 1.4 is similar to the view in the functional
world. However, the difference between program and data is eliminated. A function
is data like any other data element. Integers and functions are both first-class citizens
of the functional world.
The static data area is still present, but takes on a minor role in the functional model.
The run-time stack becomes more important because most work is accomplished
by calling functions. Functional languages are much more careful about how they
allow programmers to access the heap and as a result, you really aren’t aware of
the heap when programming in a functional language. Data is certainly dynamically
allocated, but once data is created on the heap it is not modified in a pure functional
model. Impure models might allow some modification of storage but this is the
influence of imperative languages creeping into the functional model as a way to
deal with performance issues. The result is that you spend less time thinking about
the underlying architecture when programming in a functional language.
Lisp, Scheme, Scala, Clojure, Elixir, Haskell, Caml, and Standard ML, which is
covered in this text, are all examples of functional languages. Functional languages
may be pure, which means they do not support variable updates like the imperative
model. Scheme is a pure functional language. Most functional languages are not
pure. Standard ML and Lisp are examples of impure functional languages. Scala is
a recent functional language that also supports object-oriented programming.
The logic model of computation, pictured in Fig. 1.5, is quite different from either the
imperative or functional model. In the logic model the programmer doesn’t actually
write a program at all. Instead, the programmer provides a database of facts or rules.
From this database, a single program tries to answer questions with a yes or no
answer. In the case of Prolog, the program acts in a predictable manner allowing
the programmer to provide the facts in an order that determines how the program
will work. The actual implementation of this conceptual view is accomplished by a
virtual machine, a technique for implementing languages that is covered later in this
text.
There is still the concept of a heap in Prolog. One can assert new rules and retract
rules as the program executes. To dynamically add rules or retract them there must
be an underlying heap. In fact, the run-time stack is there too. However, the run-time
stack and heap are so hidden in this view of the world that it is debatable whether
they should appear in the conceptual model at all.
1. How many programs can you write in a logic programming language like Prolog?
2. What does the programmer do when writing in Prolog?
This book explores language implementation using several small languages and
exercises that illustrate each of these models of computation. In addition, exercises
within the text will require implementation in four different languages: assembly
1.3 The Origins of a Few Programming Languages 11
language, Java (or alternatively C++), Standard ML, and Prolog. But where did
these languages come from and why are we interested in learning how to use them?
The Unix operating system was conceived of, designed, and written around 1972.
Ken Thompson was working on the design of Unix with Dennis Ritchie. It was their
project that encouraged Ritchie to create the C language. C was more structured than
the assembly language most operating systems were written in at the time and it was
portable and could be compiled to efficient machine code. Thompson and Ritchie
wanted an operating system that was portable, small, and well organized.
While C was efficient, there were other languages that had either been developed or
were being developed that encouraged a more structured approach to programming.
For several years there had been ideas floating around about how to write code
in object-oriented form. Simula, created by Ole-Johan Dahl and Kristen Nygaard
around 1967, was an early example of a language that supported Object-Oriented
design. Modula-2, created by Niklaus Wirth around 1978, was also taking advantage
of these ideas. Smalltalk, an interpreted language, was object-oriented and was also
developed in the mid 1970s and released in 1980.
In 1980 Bjarne Stroustrup, pictured in Fig. 1.6, began working on the design of
C++ while working at Bell Labs. He envisioned C++ as a language that would allow
C programmers to keep their old code while new code could be written using these
Object-Oriented concepts. In 1983 he named this new language C++, as in the next
increment of C, and with much anticipation, in 1985 the language was released.
About the same time Dr. Stroustrup released a book called The C++ Programming
Language [19], which described the language. The language is still evolving. For
instance, templates, an important part of C++ were first described by Stroustrup in
1988 [17] and it wasn’t until 1998 that it was standardized as ANSI C++. Today
an ANSI committee oversees the continued development of C++. The latest C++
standard was released in 2014 as of this writing. The previous standard was released
in 2011. C++ is a mature language, but is still growing and evolving. The 2017
standard is currently in the works with comments presently being solicited by the
standards committee.
C++ is a very powerful language, but also demands that programmers be very careful
when writing code. The biggest problem with C++ programs are memory leaks. When
objects are created on the heap in C++, they remain on the heap until they are freed.
If a programmer forgets to free an object, then that space cannot be re-used while the
program is running. That space is gone until the program is stopped, even if no code
has a pointer to that object anymore. This is a memory leak. And, for long-running
C++ programs it is the number one problem. Destructors are a feature of C++ that
help programmers prevent memory leaks. Depending on the structure of a class in
your program, it may need a destructor to take care of cleaning up instances of itself
(i.e. objects of the class) when they are freed.
C++ programs can create objects in the run-time stack, on the heap, or within
other objects. This is another powerful feature of C++. But, with this power over the
creation of objects comes more responsibility for the programmer. This control over
object creation leads to the need for extra code to decide how copies of objects are
made. In C++ every class may contain a copy constructor so the programmer can
control how copies of objects are made.
In 1991 a team called the Green Team, was working for a company named Sun
Microsystems. This group of software engineers wanted to design a programming
language and run-time system that could be used in the next generation of personal
devices. The group was led by a man named James Gosling. To support their vision,
they designed the Java Virtual Machine (i.e. JVM), a program that would interpret
byte code files. The JVM was designed as the run-time system for the Java program-
ming language. Java programs, when compiled, are translated into bytecode files that
run on the JVM.
The year 1995 brought the birth of the world wide web and with it one of the first
web browsers, Netscape Navigator, which later became Mozilla Firefox. In 1995 it
was announced that Netscape would include Java technology within the browser.
This led to some of the initial interest in the language, but the language has grown
way beyond web browsers. In fact, Java is not really a web browser technology
anymore. It is used in many web backends, where Java programs wait for connections
from web browsers, but it doesn’t run programs within web browsers much these
days. Another language, Javascript, is now the primary language of web browsers.
Javascript is similar to Java in name, but not its technology. Javascript was licensed
as a name from Sun Microsystems in its early days because of the popularity of
Java [22].
The original intention of Java was to serve as a means for running software for
personal devices. Java has become very important in that respect. It now is the basis
for the Android operating system that runs on many phones and other personal
devices like tablets. So, in a sense, the original goal of the Green Team has been
realized, just fifteen or so years later.
1.3 The Origins of a Few Programming Languages 13
When the original Green Team was designing Java they wanted to take the best
of C++ while leaving behind some of its complexity. In Java objects can only be
created in one location, on the heap. Sticking to one and only one memory model for
objects simplifies many aspects of Java. Objects are never copied by the language. So,
copy constructors are unnecessary in Java. When an object is passed to a function, a
reference to an object is passed without making a copy of the object. When one object
wants to contain another object, it keeps a reference to that object. Java objects are
never stored inside other objects. Simplifying the memory model for objects means
that in Java programs we don’t have to worry about copying objects.
Objects can still be copied in Java, but making copies of objects is the responsibility
of the programmer. The Java language does not make copies. Programmers make
copies by calling a special method called clone.
Java also includes garbage collection. This means that the Java Virtual Machine
takes care of deciding when the space that an object resides in can be reclaimed. It
can be reclaimed when no other objects or code have a reference to it anymore. This
means that programmers don’t have to write destructors. The JVM manages this for
them.
So, while C++ and Java share a lot of syntax, there are many differences as well.
Java has a simpler memory model. Garbage collection removes the fear of memory
leaks in Java programs. The Java Virtual Machine also provides other advantages to
writing Java programs. This does not make C++ a bad language by any means. It’s
just that Java and C++ have different goals. The JVM and Java manage a lot of the
complexity of writing object-oriented programs, freeing the programmer from these
duties. C++ on the other hand, gives you the power to manage all the details of a
program, right down to the hardware interface. Neither is better than the other, they
just serve different purposes while the two languages also share a lot of the same
syntax.
Python was designed and implemented by Guido van Rossum, pictured in Fig. 1.7. He
started Python as a hobby project during the winter months of 1989. A more complete
history of this language is available on the web at http://python-history.blogspot.com.
Python is another object-oriented language like C++ and Java. Unlike C++, Python
is an interpreted language. Mr. van Rossum designed Python’s interpreter as a virtual
machine, like the Java Virtual Machine (i.e. JVM). But Python’s virtual machine is
not accessible separately, unlike the JVM. The Python virtual machine is an internal
implementation detail of the Python interpreter. Virtual machines have been around
for some time including an operating system for IBM mainframe computers, called
VM. Using a virtual machine when implementing a programming language can make
the language and its programs more portable across platforms. Python runs on many
different platforms like Apple’s Mac OS X, Linux, and Microsoft Windows. Virtual
machines can also provide services that make language implementation easier.
Programmers world-wide have embraced Python and have developed many
libraries for Python and written many programs. Python has gained popularity among
developers because of its portability and the ability to provide libraries to others.
Guido van Rossum states in his history of Python, “A large complex system should
have multiple levels of extensibility. This maximizes the opportunities for users,
sophisticated or not, to help themselves.” Extensibility refers to the ability to define
libraries of classes to solve problems from many different application areas. Python
is used in internet programming, server scripting, computer graphics, visualization,
Mathematics, Computer Science education, and many, many other application areas.
Mr. van Rossum continues, saying “In many ways, the design philosophy I used
when creating Python is probably one of the main reasons for its ultimate success.
Rather than striving for perfection, early adopters found that Python worked “well
enough” for their purposes. As the user-base grew, suggestions for improvement
were gradually incorporated into the language.” Growing the user-base has been
key to the success of Python. As the number of programmers that know Python
has increased so has interest in improving the language. Python now has two major
versions, Python 2 and Python 3. Python 3 is not backward compatible with Python
2. This break in compatibility gave the Python developers an opportunity to make
improvements in the language. Chapters 3 and 4 cover some of the implementation
details of the Python programming language.
prover was developed to check proofs constructed in a particular type of logic first
proposed by Dana Scott in 1969 and now called Scott Logic. Robin Milner, pictured
in Fig. 1.8, was the principal designer of the LCF system. Milner designed the first
version of LCF while at Stanford University. In 1973, Milner moved to Edinburgh
University and hired Lockwood Morris and Malcolm Newey, followed by Michael
Gordon and Christopher Wadsworth, as research associates to help him build a new
and better version called Edinburgh LCF [9].
For the Edinburgh version of LCF, Dr. Milner and his associates created the ML
programming language to allow proof commands in the new LCF system to be
extended and customized. ML was just one part of the LCF system. However, it
quickly became clear that ML could be useful as a general purpose programming
language. In 1990 Milner, together with Mads Tofte and Robert Harper, published
the first complete formal definition of the language; joined by David MacQueen,
they revised this standard to produce the Standard ML that exists today [16].
ML was influenced by Lisp, Algol, and the Pascal programming languages. In
fact, ML was originally implemented in Lisp. There are now two main versions of
ML: Moscow ML and Standard ML. Today, ML’s main use is in academia in the
research of programming languages. But, it has been used successfully in several
other types of applications including the implementation of the TCP/IP protocol
stack [4] and a web server as part of the Fox Project. A goal of the Fox Project was
the development of system software using advanced programming languages [10].
ML is a very good language to use in learning to implement other languages.
It includes tools for automatically generating parts of a language implementation
including components called a scanner and a parser which are introduced in Chap. 6.
These tools, along with the polymorphic strong type checking provided by Standard
ML, make implementing a compiler or interpreter a much easier task. Much of the
work of implementing a program in Standard ML is spent in making sure all the
types in the program are correct. This strong type checking often means that once a
16 1 Introduction
program is properly typed it will run the first time. This is quite a statement to make,
but nonetheless it is often true.
Important Standard ML features include:
Prolog was developed in 1972 by Alain Colmerauer, pictured in Fig. 1.9, with
Philippe Roussel. Colmerauer and Roussel and their research group had been work-
ing on natural language processing for the French language and were studying logic
and automated theorem proving [7] to answer simple questions in French. Their
research led them to invite Robert Kowalski, pictured in Fig. 1.10, who was working
in the area of logic programming and had devised an algorithm called SL-Resolution,
to work with them in the summer of 1971 [11,29]. Colmerauer and Kowalski, while
working together in 1971, discovered a way formal grammars could be written as
clauses in predicate logic. Colmerauer soon devised a way that logic predicates could
be used to express grammars that would allow automated theorem provers to parse
natural language sentences efficiently. This is covered in some detail in Chap. 7.
In the summer of 1972, Kowalski and Colmerauer worked together again and
Kowalski was able to describe the procedural interpretation of what are known as
Horn Clauses. Much of the debate at the time revolved around whether logic pro-
gramming should focus on procedural representations or declarative representations.
The work of Kowalski showed how logic programs could have a dual meaning, both
procedural and declarative.
Colmerauer and Roussel used this idea of logic programs being both declarative
and procedural to devise Prolog in the summer and fall of 1972. The first large
Prolog program, which implemented a question and answering system in the French
language, was written in 1972 as well.
Later, the Prolog language interpreter was rewritten at Edinburgh to compile
programs into DEC-10 machine code. This led to an abstract intermediate form
that is now known as the Warren Abstract Machine or WAM. WAM is a low-level
intermediate representation that is well-suited for representing Prolog programs.
The WAM virtual machine can be (and has been) implemented on a wide variety
of hardware. This means that Prolog implementations exist for most computing
platforms.
1.4.1 Compilation
When you are done, you have a source program and an executable program that
represent the same computation, one in the source language, the other in machine
language. If you make further changes to the source program, the source program and
the machine language program are not in sync. After making changes to the source
program you must remember to recompile before running the executable program
again.
Machine language is specific to a CPU architecture and operating system. Com-
piling a source program on Linux means it will run on most Linux machines with a
similar CPU. However, you cannot take a Linux executable and put it on a Microsoft
Windows machine and expect it to run, even if the two computers have the same
CPU. The Linux and Windows operating systems each have their own format for
executable machine language programs. In addition, compiled programs use operat-
ing system services for printing, reading input, and doing other Input/Output (I/O)
operations. These services are invoked differently between operating systems. Lan-
20 1 Introduction
guages like C++ hide these implementation details from you in the code generator,
but the end result is that a program compiled for one operating system will not work
on another operating system without being recompiled.
C, C++, Pascal, Fortran, COBOL and many others are typically compiled lan-
guages. On the Linux operating system the C compiler is called gcc and the C++
compiler is called g++. The g in both names reflects the fact that both compilers
come out of the GNU project and the Free Software Foundation. Linux, gcc, and
g++ are freely available to anyone who wants to download them. The best way to
get these tools is to download a Linux distribution and install it on a computer. The
gcc and g++ compilers come standard with Linux.
There are implementations of C and C++ for many other platforms. The web site
http://gcc.gnu.org contains links to source code and to prebuilt binaries for the g++
compiler. You can also download C++ compilers from Apple and Microsoft. For
Mac OS X computers you can get C++ by downloading the XCode Developer Tools.
1.4 Language Implementation 21
You can also install g++ and gcc for Mac OS X computers using a tool called brew.
If you run Microsoft Windows you can install Visual C++ Express from Microsoft.
It is free for educational use.
1.4.2 Interpretation
Each time your program is executed it is translated into an AST by a part of the
interpreter called the parser. There may be an additional step that translates the
AST to some lower-level representation, often called bytecode. In an interpreter, this
lower-level representation is still internal to the interpreter program. Then a part of
the interpreter, often called a virtual machine, executes the byte code instructions.
Not every interpreter translates the AST to bytecode. Sometimes the interpreter
directly interprets the AST but it is often convenient to translate the source program’s
AST to some simpler representation before executing it.
Eliminating the compile step has a few implications.
• Since you have one less step in development you may be encouraged to run your
code more frequently during development. This is a generally a good thing and
can shorten the development cycle.
• Secondly, because you don’t have an executable version of your code, you don’t
have to manage the two versions. You only have a source code program to keep
track of.
• Finally, because the source code is not platform dependent, you can usually easily
move your program between platforms. The interpreter insulates your program
from platform dependencies.
Of course, source programs for compiled languages are generally platform indepen-
dent too. But, they must be recompiled to move the executable program from one
22 1 Introduction
platform to another. The interpreter itself isn’t platform independent. There must
be a version of an interpreter for each platform/language combination. So there is
a Python interpreter for Linux, another for Microsoft Windows, and yet another
for Mac OS X. Thankfully, because the Python interpreter is written in C the same
Python interpreter program can be compiled (with some small differences) for each
platform.
There are many interpreted languages available including Python, Ruby, Standard
ML, Unix scripting languages like Bash and Csh, Prolog, and Lisp. The portability of
interpreted languages has made them very popular among programmers, especially
when writing code that needs to run across multiple platforms.
One huge problem that has driven research into interpreted languages is that
of heap memory management. Recall that the heap is the place where memory is
dynamically allocated. As mentioned earlier in the chapter, C and C++ programs are
notorious for having memory leaks. Every time a C++ programmer reserves some
space on the heap he/she must remember to free that space. If they don’t free the
1.4 Language Implementation 23
space when they are done with it the space will never be available again while the
program continues to execute. The heap is a big space, but if a program runs long
enough and continues to allocate and not free space, eventually the heap will fill up
and the program will terminate abnormally. In addition, even if the program doesn’t
terminate abnormally, the performance of the system will degrade as more and more
time is spent managing the large heap space.
Most, if not all, interpreted languages don’t require programmers to free space
on the heap. Instead, there is a special task or thread that runs periodically as part
of the interpreter to check the heap for space that can be freed. This task is called
the garbage collector. Programmers can allocate space on the heap but don’t have
to be worried about freeing that space. For a garbage collector to work correctly,
space on the heap has to be allocated and accessed in the right way. Many interpreted
languages are designed to insure that a garbage collector will work correctly.
The disadvantage of an interpreted language is in speed of execution. Interpreted
programs typically run slower than compiled programs. In a compiled program,
parsing and code generation happen once when the program is compiled. When
running an interpreted program, parsing and code generation happen each time the
program is executed. In addition, if an application has real-time dependencies then
having the garbage collector running at more or less random intervals may not be
desirable. As you’ll read in the next section some steps have been taken to reduce
the difference in execution time between compiled and interpreted languages.
The advantages of interpretation over compilation are pretty significant. It turns out
that one of the biggest advantages is the portability of programs. It’s nice to know
when you invest the time in writing a program that it will run the same on Linux,
Microsoft Windows, Mac OS X, or some other operating system. This portability
issue has driven a lot of research into making interpreted programs run as fast as
compiled languages.
As discussed earlier in this chapter, the concept of a virtual machine has been
around quite a while. A virtual machine is a program that provides insulation from
the actual hardware and operating system of a machine while supplying a consistent
implementation of a set of low-level instructions, often called bytecode. Figure 1.14
shows how a virtual machine sits on top of the operating system/CPU to act as this
insulator.
There is no one specification for bytecode instructions. They are specific to the
virtual machine being defined. Python has a virtual machine buried within the inter-
preter. Prolog is another interpreter that uses a virtual machine as part of its imple-
mentation. Some languages, like Java have taken this idea a step further. Java has a
virtual machine that executes bytecode instructions as does Python. The creators of
Java separated the virtual machine from the compiler. Instead of storing the bytecode
instructions internally as in an interpreter, the Java compiler, called javac, compiles
a Java source code program to a bytecode file. This file is not machine language
so it cannot be executed directly on the hardware. It is a Java bytecode file which
24 1 Introduction
is interpreted by the Java virtual machine, called java in the Java set of tools. Java
bytecode files all end with a .class extension. You may have noticed these files at
some point after compiling a Java program.
Programs written using a hybrid language like Java are compiled. However, the
compiled bytecode program is interpreted. Source programs in the language are not
interpreted directly. By adding this intermediate step the interpreter can be smaller
and faster than traditional interpreters. Very little parsing needs to happen to read
the program and executing the program is straightforward because each bytecode
instruction usually has a simple implementation.
Languages that fall into this virtual machine category include Java, ML, Python,
C#, Visual Basic .NET, JScript, and other .NET platform languages. You might notice
that Standard ML and Python were included as examples of interpreted languages.
Both ML and Python include interactive interpreters as well as the ability to compile
and run low-level bytecode programs. Python bytecode files are named with a .pyc
extension. Standard ML compiled files are named with a -platform as the last part of
1.4 Language Implementation 25
the compiled file name. In the case of Python and Standard ML the virtual machine
is not a separate program. Both interpreters are written to recognize a bytecode file
and execute it just like a source program.
Java and the .NET programming environments do not include interactive inter-
preters. The only way to execute programs with these platforms is to compile the
program and then run the compiled program using the virtual machine. Programs
written for the .NET platform run under Microsoft Windows and in some cases
Linux. Microsoft submitted some of the .NET specifications to the ISO to allow
third party software companies to develop support for .NET on other platforms. In
theory all .NET programs are portable like Java, but so far implementations of the
.NET framework are not as generally available as Java. The Java platform has been
implemented and released on all major platforms. In fact, in November 2006 Sun, the
company that created Java, announced they were releasing the Java Virtual Machine
and related software under the GNU Public License to encourage further develop-
ment of the language and related tools. Since then the rights to Java have now been
purchased by Oracle where it continues to be supported.
Java and .NET language implementations maintain backwards compatibility of
their virtual machines. This means that a program compiled for an earlier version of
Java or .NET will continue to run on newer implementations of the language’s virtual
machine. In contrast, Python’s virtual machine is regarded as an internal design issue
and does not maintain backwards compatibility. A .pyc file compiled for one version
of Python will not run on a newer version of Python. This distinction makes Python
more of an interpreted language, while Java and .NET languages are truly virtual
machine implementations.
Maintaining backwards compatibility of the virtual machine means that program-
mers can distribute application for Java and .NET implementations without releasing
their source code. .NET and Java applications can be distributed while maintaining
privacy of the source code. Since intellectual property is an important asset of compa-
nies, the ability to distribute programs in binary form is important. The development
of virtual machines made memory management and program portability much easier
in languages like Java, Standard ML, and the various .NET languages while also pro-
viding a means for programmers to distribute programs in binary format so source
code could be kept private.
Every programming language defines operations that can be used to transform data.
Data transformation is the fundamental operation that is performed by all program-
ming languages. Some programming languages mutate data to new values. Other
languages transform data by building new values from old values. However the
transformation takes place, these data transformation operations are defined for cer-
tain types of data. Not every transformation operation makes sense for every type of
value. For instance, addition is an operation that makes sense for numbers, but does
26 1 Introduction
not make any sense for customers. How would you add two customers together and
what would that mean?
Since programming languages define data transformation operations, they simi-
larly define types to specify which operations make sense on which types of data.
Types in programming languages include integers, booleans, real numbers (i.e. some-
times called floating point numbers), strings, lists, tuples, and user-defined types like
customers. Transformation operations are defined operators on these values. The
plus sign (e.g. +) often defines addition. String concatenation might also be denoted
by the plus sign. Or it might be some other symbol.
One of the jobs of a programming language implementation is to determine which
operation is meant when, for instance, the plus sign is written in a program. Does
it mean the addition of two numbers, string concatenation, or is it an error because
you can’t add two customers together? Determining if the plus sign makes sense in
the context of its operands (i.e. the two things being added together) is the job of a
programming language implementation. More generally, the programming language
implementation is responsible for checking that the operations performed on its data
types are defined and the programming language is responsible for invoking the
correct operation.
There are two different times that this type checking might occur. Some pro-
gramming languages defer all type checking until the last possible second when
the program is actually executing. When the next operation occurs, a programming
language implementation may terminate a program and report that the next opera-
tion to be executed is not defined. This is called a dynamically typed programming
language.
Python is a dynamically typed programming language. You don’t find out that an
operation is undefined until the operation is about to be executed. No earlier warning
is given. When the code is executed, if you try to add two customers together, you
find out that this has not been defined.
Other programming languages report any operation that is not defined before the
program begins execution. In this case the programming language is statically typed.
A statically typed language goes through a step during before execution where type
checking is performed to see if the operations are defined for the given types of
operands. This type checking step is performed in languages like Java and C++.
These languages are statically typed.
An important facet of Standard ML is the strong type checking provided by the
language. The type inference system, commonly called Hindley-Milner type infer-
ence, statically checks the types of all expressions and operations in the language.
In addition, the type checking system is polymorphic, meaning that it handles types
that may contain type variables. The polymorphic type checker is sound. It will
never say a program is typed correctly when it is not. Interestingly, the type checker
has also been proven complete, which means that all correctly typed programs will
indeed pass the type checker. No correctly typed program will be rejected by the
type checker. We expect soundness out of type checkers but completeness is much
harder to prove and it has been proven for Standard ML.
1.5 Types and Type Checking 27
There are trade-offs between statically and dynamically typed languages. Typi-
cally there is more overhead to programming with a statically typed language. Types
in C++ and Java must be declared so that static type checking can be performed.
But this is not always the case. Standard ML infers the types of most values in the
language without requiring the types of its values to be declared.
Dynamically typed languages typically require less overhead in declaring values.
In Python you don’t declare the value of any object, except through the creation of
that object. Writing
x = 6
p r i n t (x+x)
The history of languages is fascinating and a lot more detail is available than was
covered in this chapter. There are many great resources on the web where you
can get more information. Use Google or Wikipedia and search for “History of
your_favorite_language” as a place to begin. However, be careful. You can’t believe
everything you read on the web and that includes Wikipedia. While the web is a great
source, you should always research your topic enough to independently verify the
information you find there.
While learning new languages and studying programming language implementa-
tion it becomes important to understand models of computation. A compiler translates
a high-level programming language into a lower level computation. These low-level
computations are usually expressed in terms of machine language but not always.
More important than the actual low-level language is the model of computation. Some
models are based on register machines. Some models are based on stack machines.
Still other models may be based on something entirely different. Chapters 3 and 4
explore stack-based virtual machines in much more detail.
28 1 Introduction
The next chapter provides the foundations for understanding how the syntax of a
language is formally defined by a grammar. Then chapter three introduces a Python
Virtual Machine implementation called JCoCo. JCoCo is an interpreter of Python
bytecode instructions. Chapter three introduces assembly language programming
using JCoCo, providing some insight into how programming languages are imple-
mented.
Subsequent chapters in the book will again look at language implementation to
better understand the languages you are learning, their strengths and weaknesses.
While learning these languages you will also be implementing a compiler for a high
level functional language called Small which is a robust subset of Standard ML. This
will give you even more insight into language implementation and knowledge of
how to use these languages to solve problems.
Finally, in the last two chapters of this text, you will learn about type checking
and type inference using Prolog, a language that is well-suited to logic problems like
type inference. Learning how to use Prolog and implement a type checker is a great
way to cap off a text on programming languages and language implementation.
A great way to summarize the rest of this text is to see it moving from very
prescriptive approaches to programming to very descriptive approaches to program-
ming. The word prescriptive means that you dwell on details, thinking very carefully
about the details of what you are writing. For instance, in a prescriptive approach
you might ask yourself, how do you set things up to invoke a particular type of
instruction? In contrast, descriptive programming relies on programmers describing
relationships between things. Functional programming languages, to some extent,
and logic programming languages employ this descriptive approach to programming.
Read on to begin the journey from prescriptive to descriptive programming!
1. What are the three ways of thinking about programming, often called program-
ming paradigms?
2. Name at least one language for each of the three methods of programming
described in the previous question.
3. Name one person who had a great deal to do with the development of the impera-
tive programming model. Name another who contributed to the functional model.
Finally, name a person who was responsible for the development of the logic
model of programming.
4. What are the primary characteristics of each of the imperative, functional, and
logic models?
5. Who are recognized as the founders of each of the languages this text covers:
Java, C++, Python, Standard ML, and Prolog?
6. Name a language, other than Python, C++, or Java, that is imperative object-
oriented in nature.
7. Name a language besides Standard ML, that is a functional programming lan-
guage.
1.7 Review Questions 29
8. What other logic programming languages are there other than Prolog? You might
have to get creative on this one.
9. Why is compiling a program preferred over interpreting a program?
10. Why is interpreting a program preferred over compiling a program?
11. What benefits do virtual machine languages have over interpreted languages?
12. What is a bytecode program? Name two languages that use bytecode in their
implementation.
13. Why are types important in a programming language?
14. What does it mean for a programming language to be dynamically typed?
15. What does it mean for a programming language to be statically typed?
These are solutions to the practice problems. You should only consult these answers
after you have tried each of them for yourself first. Practice problems are meant to
help reinforce the material you have just read so make use of them.
1. The origins of the three models are the Turing Machine, the λ-calculus, and
propositional and predicate logic.
2. Alan Turing as a PhD student of Alonzo Church. Alan Turing developed the Turing
Machine and Alonzo Church developed the λ-calculus to answer prove there were
somethings that are not computable. They later proved the two approaches were
equivalent in their power to express computation.
3. Both von Neumann and Turing contributed to the idea of a stored-program com-
puter.
4. Backus developed BNF notation which was used in the development of Algol 60.
5. 1936 was a big year for Computer Science.
6. So was 1946. That was the year ENIAC was unveiled. Eckert and Mauchly
designed and built ENIAC.
7. The problems in Mathematics were growing complex enough that many mathe-
maticians were developing models and languages for expressing their algorithms.
This was one of the driving factors in the development of computers and Computer
Science as a discipline.
1. The run-time stack, global memory, and the heap are the three divisions of data
memory.
2. Data on the heap is created at run-time.
30 1 Introduction
3. An activation record holds information like local variables, the program counter,
the stack pointer, and other state information necessary for a function invocation.
4. An activation record is created each time a function is called.
5. An activation record is deleted when a function returns.
6. The primary goal of imperative, object-oriented programming is to update mem-
ory by updating variables and/or objects as the program executes. The primary
operation is memory updates.
1. You never write a program in Prolog. You write a database of rules in Prolog that
tell the single Prolog program (depth first search) how to proceed.
2. The programmer provides a database of facts and predicates that tell Prolog
about a problem. In Prolog the programmer describes the problem instead of
programming the solution.
1. C++ was invented by Bjourne Stroustrup. C was created by Dennis Ritchie. Stan-
dard ML was primarily designed by Robin Milner. Prolog was designed by Alain
Colmerauer and Philippe Roussel with the assistance of Robert Kowalski. Python
was created by Guido van Rossum. Java was the work of the Green team and James
Gosling.
2. Standard ML and Prolog were both designed as languages for automated theorem
proving first. Then they became general purpose programming languages later.
3. Both Python and Prolog run on virtual machine implementations. Python’s virtual
machine is internal to the interpreter. Prolog’s virtual machine is called WAM
(Warren Abstract Machine).
4. Standard ML is influenced by Lisp, Pascal, and Algol.
Syntax
2
2.1 Terminology
Many questions we might like to ask about a program either relate to the syntax
of the language or to its semantics. It is not always clear which questions pertain to
© Springer International Publishing AG 2017 31
K.D. Lee, Foundations of Programming Languages, Undergraduate Topics
in Computer Science, https://doi.org/10.1007/978-3-319-70790-7_2
32 2 Syntax
syntax and which pertain to semantics. Some questions may concern semantic issues
that can be determined statically, meaning before the program is run. Other semantic
issues may be dynamic issues, meaning they can only be determined at run-time.
The difference between static semantic issues and syntactic issues is sometimes a
difficult distinction to make.
The code
a=b+c;
is correct syntax in many languages. But is it a correct C++ statement?
There are lots of questions that need to be answered about this assignment statement.
Some questions could be answered sooner than others. When a C++ program is
compiled it is translated from C++ to machine language as described in the previous
chapter. Questions 2 and 3 are issues that can be answered when the C++ program
is compiled. However, the answer to the first question might not be known until
the C++ program executes in some cases. The answers to questions 2 and 3 can
be answered at compile-time and are called static semantic issues. The answer to
question 1 is a dynamic issue and is probably not determinable until run-time. In
some circumstances, the answer to question 1 might also be a static semantic issue.
Question 4 is definitely a syntactic issue.
Unlike the dynamic semantic issues, the correct syntax of a program is statically
determinable. Said another way, determining a syntactically valid program can be
accomplished without running the program. The syntax of a programming language
is specified by a grammar. But before discussing grammars, the parts of a grammar
must be defined. A terminal or token is a symbol in the language.
Keywords, types, operators, numbers, identifiers, etc. are all tokens or terminals in
a language.
A syntactic category or nonterminal is a set of phrases, or strings of tokens,
that will be defined in terms of symbols in the language (terminal and nonterminal
symbols).
Backus Naur Format (i.e. BNF) is a formal metalanguage for describing language
syntax. The word formal is used to indicate that BNF is unambiguous. Unlike English,
the BNF language is not open to our own interpretations. There is only one way to
read a BNF description.
BNF was used by John Backus to describe the syntax of Algol in 1963. In 1960,
John Backus and Peter Naur, a computer magazine writer, had just attended a confer-
ence on Algol. As they returned from the trip it became apparent that they had very
different views of what Algol would look like. As a result of this discussion, John
Backus worked on a method for describing the grammar of a language. Peter Naur
slightly modified it. The notation is called BNF, or Backus Naur Form or sometimes
Backus Normal Form. BNF consists of a set of rules that have this form:
The symbol ::= can be read as is composed of and means the syntactic category is
the set of all items that correspond to the right hand side of the rule.
Multiple rules defining the same syntactic category may be abbreviated using the |
character which can be read as “or” and means set union. That is the entire language.
It’s not a very big metalanguage, but it is powerful.
< type - specifier > < method - declarator > < throws - clause > < method - body > |
< type - specifier > < method - declarator > < method - body >
This description can be described in English: The set of method declarations is the
union of the sets of method declarations that explicitly throw an exception with those
that don’t explicitly throw an exception with or without modifiers attached to their
definitions. The BNF is much easier to understand and is not ambiguous like this
English description.
N = {E, T, F}
T = {identi f ier, number, +, −, ∗, /, (, )}
P is defined by the set of productions
E→E + T |E − T |T
T →T ∗ F|T /F|F
F → ( E ) | identi f ier | number
2.4 Derivations
2.4.1 A Derivation
E ⇒ E + T ⇒ T + T ⇒ F + T ⇒ (E) + T ⇒ (T ) + T ⇒ (T ∗ F) + T
⇒ (F ∗ F) + T ⇒ (5 ∗ F) + T ⇒ (5 ∗ x) + T ⇒ (5 ∗ x) + F ⇒ (5 ∗ x) + y
Each step is a sentential form. The underlined nonterminal in each sentential form is
replaced by the right hand side of a production for that nonterminal. The derivation
proceeds from the start symbol, E, to the sentence (5 ∗ x) + y. This proves that
(5 ∗ x) + y is in the language L(G) as G is defined in Sect. 2.3.1.
Discovering Diverse Content Through
Random Scribd Documents
"Yes," said Laura, gravely. "Here is a ghost we found in Nathalie's
room. I presume you have the best right to it!"
She handed him the book before them all, and every eye was turned
upon him as he glanced at the title-page. His face changed, in spite
of all his self-control, turning nearly as colorless as Miss
Henderson's.
"I believe I did give Miss Marsh this once," he said, trying to be at
his ease. "I suppose you gave the rats a rare fright! There's the
music. Miss McGregor, I believe I have this dance?"
The band was playing the "Aline Polka," and no mortal feet could
resist that. All the girls were soon whirling about like teetotums, and
the elderly folks sat down for a game of euchre on the grass. Olive
Henderson, declining, coldly, a dozen eager aspirants for the honor
of her hand in the polka, strolled off unsociably herself, as she had
done before. They were too busy enjoying themselves to notice her
absence at first, and only one followed her. That one was poor Tom
Oaks; and to him, in her absence, the sun was without light, the
world empty, since the universe held but her. She did not hear him—
she was leaning against a tree, looking out with that darkly-brooding
face of hers, over the spreading fields and wood, sloping down to
the sea, and all her own. Looking out over that wide sea, with a
dreary stare, that told plainly all the wealth she had inherited, all the
love and admiration she had won, had not the power to make her
happy. Her white dress fluttered in the spring breeze; her shawl, of
rich gold-colored crape, fell in loose, graceful folds, like sunlight-
drapery, around her, held together with one little brown hand. Her
head was bare, and the shining profusion of thick black hair was
twisted in great serpent-like coils around her head. She looked more
sultana-like than ever, holding that mass of glowing golden drapery
around her, a woman to command a kingdom, not to be wooed for a
household-angel; but that poor Tom Oaks was down on the grass at
her feet, before she knew he was near, imploring her to take pity
upon him. Heaven only knows what he said—Tom never did; but he
was pouring out his whole heart in a vehement outburst of
passionate pleading. The man had chosen an unpropitious moment.
"Get up, Mr. Oaks," the cold sweet voice said; "don't make such a
scene! Hush! some one will hear you."
She might as well have told a rushing waterfall to hush. Tom got up,
pleading vehemently, passionately, wildly, for what seemed to him—
poor, foolish fellow!—more than life.
"No, no, no!" she said, impatiently; "go away, Mr. Oaks. It is of no
use."
It seemed like the old parable of asking for bread and receiving a
stone. Tom Oaks turned away, but something in his despairing face
touched her woman's heart. She laid her hand lightly on his arm,
and looked compassionately into his white face.
"I am sorry," she said, in a voice that faltered a little, "I am sorry! I
did not think you cared for me like this, but I cannot help you! You
must forget me, Mr. Oaks!"
There was one other witness to this little love-passage besides the
birds, singing their songs, in the green branches. Captain Cavendish
had seen Tom Oaks follow Olive Henderson off the grounds, and
knew, by the prescience of jealousy, as well what was going to
happen, as he did after the scene was over. He had followed the
young man, and, in the tangled green heart of the wood, had heard
every word, and watched the white and amber figure flit out of
sight. He leaned against a tree now, almost as pale as Tom Oaks had
been. But if she should refuse him, too! It was the first time in his
life he had ever asked himself that question; and he had made love,
and offered marriage even, to more than Winnifred Rose and
Nathalie Marsh. What if she should refuse him like this? Pride, love,
ambition, all were at stake with Captain Cavendish now, and what if
he should lose her? He set his breath and clenched his hand at the
thought.
"I will not lose her!" he said to himself. "I will not! I should go as
mad as that idiot on the grass there is, if I lost that glorious girl!"
He might have gone after her, and proposed on the spot, had he not
possessed so fully that sixth sense, tact. Like the lady immortalized
in the Irish poem of "Paddy, Would You Now," she must be taken
when she was "in the humor," and that most decidedly was not to-
day. So he strolled back to the rest, and had the satisfaction of
seeing her waltzing with his superior officer, Major Marwood, who
was unmarried, and rich, and one of her most obedient very humble
servants.
The picnic was to wind up with what Mr. Blake called a "danceable
tea," at Mr. Darcy's, whither they all drove, in the pleasant April
twilight, and the handsome captain enjoyed the privilege of sitting
beside the heiress in the pony carriage, to the great envy of every
one else. They drove very slowly, watching the moon rise in a long
glory of silvery radiance over the sleeping sea, while he told her of
Italian moon-rises, and Alpine sunsets, he had gazed upon; and she
listened, lying back with half-vailed eyes, and a longing sensation of
pleasure in it all at her heart. Was she in love with Captain
Cavendish? No; but she liked him best of all her admirers; and there
were few women who would not have listened with pleased interest
to those vivid word-pictures of far-off lands, and looked with
admiration, at least, into that pale, high-bred, classically handsome
face.
Captain Cavendish retained his advantage all that evening, and left
competitors far behind. He sang duets with Miss Henderson, danced
with her, took her in to supper, and folded the shawl around her
when they were going home. She might be the veriest iceberg to-
morrow, the haughtiest and most imperious Cleopatra; but she was
gentle, and graceful, and all feminine sweetness to-night. His hopes
were high, his heart all in a glow of thrilling ecstasy, as he went
home, under the serene stars. The cup of bliss was almost at his
lips, and the many slips were quite forgotten.
The afternoon following the picnic, Olive sat in her cottage drawing-
room entertaining some callers. The callers were Major Marwood,
Lieutenant Blank, and Captain Cavendish. Mrs. Darcy, who was
spending the day with her, sat at a window crotcheting, and playing
propriety, with Mrs. Hill and Mrs. Hill's niece, Miss Clowrie. Somehow
this young lady was very fond of dropping in to see her aunt, and
staying for dinner, and often all night. The heiress sat at the piano,
playing some exquisite "song without words," when a servant
entered and ushered in Miss Blair. The officers, who had been there
some time, took their departure, and Laura burst out into
thanksgiving.
"Now, thank goodness! they're gone. Run up and get your hat, Olly,
and come down to see the boat come in."
"I don't care about seeing the boat come in," said the heiress, lazily,
lying back in a fauteuil. "I feel comfortable where I am."
"But you must come, I tell you!" cried Laura, "there's a lot of
delegates coming from somewhere, about something, and
everybody will be there, and I want to see them."
Miss Henderson laughed at this lucid explanation.
"I shan't go," she said.
Miss Blair changed from the imperative mood to the potential,
exhorting, entreating.
"Now, Olly, don't be hateful, but go and put your things on, like a
darling. I am just dying to go, and I can't go without you, so do
come, there's a dear!"
"But don't you see I have company," laughed Olive; "I can't be rude;
I can't leave them."
"Nonsense, Olive, my love," cut in Mrs. Darcy; "you don't call Catty
and I strangers, I hope. Go down to the wharf; the sea-breeze will
sharpen your appetite for dinner."
"A very romantic reason, certainly," said Olive, sauntering out of the
room, however. "You had better come too, Miss Clowrie."
This was said for politeness' sake, for the attorney's daughter was
no favorite with the heiress. Catty, only too glad to be seen in public
with Miss Henderson, accepted at once, and went up to dress.
"Is it true, Laura," asked Mrs. Darcy, "that Miss Rose came back last
night?"
"Yes," said Laura, "she called this morning, and I was so glad to see
her. She looks extremely well. England must have agreed with her."
"Where is she stopping? I should like to see her."
"At —— House, with Mrs. and Major Wheatly. She told me she would
be at the boat this afternoon, when she would see all the old faces,
if Speckport had not changed greatly in her absence."
"Tell her to call and see me," said Mrs. Darcy; "I always liked Miss
Rose. I think she has the sweetest face I ever saw."
"Now, then, Laura," exclaimed Olive, appearing at the door with
Catty, "I am ready, and I hear the steamer blowing."
The three young ladies walked down to the wharf, which, as usual,
was crowded. One of the first persons they met was Val Blake,
watching the passengers, who were beginning to come up the floats,
running the gauntlet of all eyes. He was telling them something
about Tom Oaks, who had started off up the country, when he
stopped in the middle of what he was saying with a sort of shout of
astonishment, and stared at a gentleman coming up the floats, with
a valise in one hand, and an overcoat across his arm.
"Now, of all the people coming and going on the face of the earth,"
cried out Mr. Blake, in his amazement, "whatever has sent Paul
Wyndham to Speckport?"
The next instant he was off, flinging the crowd right and left out of
his way, and arresting the traveler with a sledge-hammer tap on the
shoulder. The girls laughingly watched him, as he shook the
stranger's hand as vigorously as if he meant to wrench it off, crying
out in a voice that everybody heard: "Why, Wyndham, old fellow!
what the deuce drove you here?"
Mr. Wyndham smiled quietly at his impetuous friend, and walked
away with him to a cab, which they both entered, and Olive
Henderson, still laughing at Mr. Blake, looked carelessly after them,
and never dreamed that she had met her fate. No; who ever does
dream it, when they meet that fate first!
So Paul Wyndham passed Olive Henderson, and the curtain of the
future shrouded the web of life destiny was weaving. She forgot him
as soon as seen, and turned to Laura, who was speaking animatedly.
"Look, Olly! there's the Miss Rose you have heard me speaking of so
often—that little girl with the black silk dress and mantle, and black
straw hat, talking to Miss Blake. Look! hasn't she the sweetest face!
I'll call her over."
The crowd of men, women and children, thronging the wharf and
floats, were strangely startled a moment after, and every eye turned
in one direction. There had been a long, wild, woman's shriek, and
some one had reeled and fallen to the ground like a log. There was
a rushing and swaying, and startled talking among the people; and
Dr. Leach, coming along, took the Rev. Augustus Tod by the button,
and wanted to know what was the matter.
"Miss Olive Henderson had fainted," the Rev. Augustus said, with a
startled face. "She had been standing on the wharf, apparently quite
well, only a second before, when she had suddenly screamed out
and fallen down in a fainting-fit. It was really quite shocking."
CHAPTER XXV.
THE DOUBLE COMPACT.
Olive Henderson lay on a sofa in her bedroom, her face half buried
among the pillows, her cloud of tar-black hair all loose and
disordered, falling about her, and still wearing the out-door dress of
yesterday. Bright streaks of crimson glory, in the dull dawn sky,
heralded the rising of another sun, of another day to the restless,
feverish little planet below. Dressed in that uncomfortable attire for
repose, Olive Henderson, while the red morning broke, lay there and
slept. Stuff! It was more stupor than sleep, and she had only sank
into it half an hour before, from sheer physical exhaustion. Those in
the cottage had been disturbed all night long, by the sound of
restless footsteps pacing up and down the chamber where she now
lay, up and down, up and down, ceaselessly, the livelong night.
When they had lifted her up, and carried her home in that death-
faint, and Dr. Leach had brought her to, her first act had been to
turn every soul of them out of her room, Laura Blair included, to lock
the door, and remain there alone by herself, ever since. Everybody
wondered; Catty Clowrie, most of all, and tender-hearted Laura
cried. That sympathizing confidante had gone to the locked door,
and humbly and lovingly entreated "Olly" to let her in; but Olly
turned a deaf ear to all her entreaties, and never even
condescended to reply. Mrs. Hill felt deeply on the subject of
refreshments—if her young lady would but partake of some weak
tea and dry toast, or even water-gruel, and go to bed comfortable,
and sleep it off, she would be all right to-morrow; but to shut herself
up, and her friends out, was enough to give her her death. Catty
Clowrie said very little, but she thought a good deal. She had
remained all night at the cottage, and had listened to that troubled
footstep, and had mused darkly, instead of sleeping. At day-dawn
the restless pacing had ceased, and Olive Henderson lay sleeping, a
deep, stupor-like sleep. Her face, lying among the pillows,
contrasting with her black hair, looked ghastly white in the pale
dawn, and her brows were drawn, and her position strangely
wretched and unnatural.
Mrs. Hill came to the door several times and tried to get in, but in
vain. Her feeble knocks failed to awake her young mistress from that
deep sleep, and the sun was high in the purple arch outside, before
the dark eyes slowly opened to this mortal life again. She sat up
feeling stiff, and cold, and cramped, and unrefreshed, and put the
black cloud of hair away from her face, while memory stepped back
to its post. With something like a groan she dropped her face once
more among the pillows, but this time not to sleep. She lay so still
for nearly half an hour, that not a hair of her head moved, thinking,
thinking, thinking. A terrible fear came upon her, a horrible danger
threatened her, but she was not one easily to yield to despair. She
would battle with the rising tide, battle fiercely to the last, and if the
black waves engulfed her at the end, she would die waging war
against relentless doom, to the close.
Olive Henderson rose up, twisted her disordered tresses away from
her face, searched for her ink and paper, and sat down to a little
rosewood desk, to write. It was very short, the note she rapidly
scrawled, but the whole passionate heart of the girl was in it.
"For God's sake come to me!" (this abrupt note began) "every
second is an age of agony till I see you. I thought you were
dead—as Heaven is my witness, I did, or I should never have
come here! By the memory of all the happy days we have spent
together, by the memory of your dead father, I conjure you be
silent, and come to me at once!
"H."
The note had neither date, address, nor signature, save that one
capital letter, but when it was folded and in the envelope, she wrote
the address:—"Miss W. Rose, —— House, Queen Street, Speckport."
Then, rising, she exchanged the crumpled robe in which she had
slept for one of plain black silk, hastily thrust her hair loose into a
chenille net, put on a long black silk mantle, a bonnet and thick
brown vail, placed the letter in her pocket, and went down stairs.
There was no possibility of leaving the house unseen; Mrs. Hill heard
her opening the front door and came out of the dining-room. Her
eyes opened like full moons at the sight of the street costume, and
the young lady's white, resolute face.
"My patience, Miss Olive, you're never going out?"
"Yes," Miss Henderson said, constraining herself to speak quietly.
"My head aches, and I think a walk in the air will do it good. I will be
back directly."
"But, do take something before you go. Some tea, now, and a little
bit of toast."
"No, no! not any, thank you, until I come back."
She was gone even while she spoke; the thick vail drawn over her
face, her parasol up, screening her effectually. Catty Clowrie,
watching her from the window, would have given considerable to
follow her, and see where she went. She had little faith in that walk
being taken for the sake of walking; some covert meaning lay hidden
beneath.
"I declare to you, Catty," exclaimed Mrs. Hill, coming back, "she gave
me quite a turn! She was as white as a ghost, and those big black
eyes of hers looked bigger and blacker than ever. She is turning
bilious, that's what she's doing."
Miss Henderson walked to Queen Street by the most retired streets,
and passed before the hotel, where Major and Mrs. Wheatly
boarded. She had some idea of putting the letter in the post-office
when she started, but in that case Miss Rose would not receive it
until evening, and how could she wait all that time, eating out her
heart with mad impatience? There was a man standing in the
doorway of the ladies' entrance, a waiter, and quite alone. With her
vail closely drawn over her face, Miss Henderson approached him,
speaking in a low voice:
"There is a young lady—a governess, called Miss Rose, stopping here
—is there not?"
"Yes, ma'am."
"Is she in now?"
"Yes'm."
"Will you please give her this letter! give it into her own hand, and at
once!"
She gave him the letter, and a fee that made him stare, and was
gone. The man did not know her, and Olive reached home without
once meeting any one who recognized her.
Miss Catty Clowrie did not leave the cottage all that day. She was
sewing for Mrs. Hill; and, seated at the dining-room window, she
watched Miss Henderson furtively, but incessantly, under her white
eyelashes. That young lady seemed possessed of the very spirit of
restlessness, since her return from her walk. It had not done her
much good, apparently, for it had neither brought back color nor
appetite; and she wandered from room to room, and up-stairs and
down-stairs, with a miserable feverish restlessness, that made one
fidgety to look at her. And all the time in her dark colorless face
there was only one expression, one of passionate, impatient waiting.
Waiting, waiting, waiting! For what? Catty Clowrie's greenish-gray
eyes read the look aright, but for what was she waiting?
"I'll find it out, yet," Miss Clowrie said, inwardly. "She is a very fine
lady, this Miss Olive Henderson, but there is an old adage about 'All
that glitters is not gold.' I'll wait and see."
There were a great many callers in the course of the morning, but
Miss Henderson was too indisposed to see any of them. Even Miss
Blair was sent away with this answer, when she came; but Miss
Henderson had left word, Mrs. Hill said, that she would be glad to
see Miss Laura to-morrow. Miss Henderson herself, walking up and
down the drawing-room, heard the message given, and the door
closed on her friend, and then turned to go up-stairs. She stopped to
say a word to her housekeeper as she did so.
"There is a person to call to-day, Mrs. Hill," she said, not looking at
the pilot's widow, "and you may send her up to my room when she
comes. It is Miss Rose, Mrs. Major Wheatly's governess!"
Her foot was on the carpeted stair as she said this, and she ran up
without giving her housekeeper time to reply. Catty Clowrie,
industriously sewing away, listened, and compressed her thin lips.
"Miss Rose coming to see her, and admitted to a private interview,
when every one else is excluded! Um—m—m! That is rather odd;
and Miss Rose is a stranger to her—or is supposed to be! I wonder
why she fainted at sight of Miss Rose, on the wharf, yesterday, and
why Miss Rose's face turned to pale amazement at sight of her. She
did not ask any questions, I noticed; but Miss Rose was always
discreet; and no one observed her but myself, in the hubbub. There
is something odd about all this!"
She threaded her needle afresh, and went on with her sewing, with
the patient perseverance of all such phlegmatic mortals. Mrs. Hill
came in, wondering what Miss Henderson could possibly want of
Miss Rose, but her niece could throw no light on the subject.
"Perhaps she wants a companion," Miss Clowrie remarked; "fine
ladies like Miss Henderson are full of freaks, and perhaps she wants
some one to play and sing and read to her, when she feels too lazy
to do it herself."
Catty Clowrie had read a good many novels in her life, full of all sorts
of mysteries, and secret crimes, and wicked concealments, and
conspiracies—very romantic and unlike every-day life—but still liable
to happen. She had never had the faintest shadow of romance, to
cover rosily her own drab-hued life—no secret or mystery of any sort
to happen to herself, or any of the people among whom she
mingled. The most romantic thing that had ever occurred within her
personal knowledge was the fact of this new heiress, this Olive
Henderson, rising from the offal of New York, from the most abject
poverty, to sudden and great wealth.
Miss Clowrie sat until three o'clock, sewing at the dining-room
window. Luncheon-hour was two, but Miss Henderson would not
descend, and asked to have a cup of strong tea sent up, so Mrs. Hill
and her niece partook of that repast alone. As the clock was striking
three, a young lady, dressed in half-mourning, came down the street
and rang the door-bell; and Catty, dropping her work, ran to open it,
and embrace with effusion the visitor. She had not spoken to Miss
Rose before since her return, and kissed her now, as though she
were really glad to see her.
"I am so glad you are back again, dear Miss Rose!" the young lady
cried, holding both Miss Rose's hands in hers; "you cannot think how
much we have all missed you since you went away!"
Now, it was rather unfortunate for Miss Clowrie, but nature, who will
always persist in being absurdly true to herself, had given an
insincere look to the thin, wide mouth, and a false glimmer to the
greenish-gray eyes, and a clammy, limp moistness to the cold hand,
that made you feel as if you had got hold of a dead fish, and wished
to drop it again as soon as possible. Miss Rose had taken an
instinctive aversion to Miss Clowrie the first time she had seen her,
and had never been quite able to get over it since, though she had
conscientiously tried; but she never betrayed it, and smiled now in
her own gentle smile, and thanked Miss Clowrie in her own sweet
voice. She turned to Mrs. Hill, though, when that lady appeared,
with a far different feeling, and returned the kiss that motherly old
creature bestowed upon her.
"It does my heart good to see you again, Miss Rose," the
housekeeper said. "I haven't forgotten all you did for me last year
when poor, dear Hill was lost, going after that horrid ship. You can't
think how glad I was when I heard you were come back."
"Thank you, Mrs. Hill," the governess said. "It is worth while going
away for the sake of such a welcome back. Is Miss—" she hesitated
a moment, and then went on, with a sudden flush lighting her face;
"is Miss Henderson in?"
"Yes, my dear; I will go and tell her you are here."
The housekeeper went up-stairs, but reappeared almost
immediately.
"You are to go up-stairs, my dear," she said; "Miss Henderson is not
very well, and will see you in her own room."
Miss Rose ascended the stairs, entered the chamber of the heiress,
and Catty heard the door closed and locked after her. As Mrs. Hill re-
entered the dining-room, she found her gathering up her work.
"I left the yokes and wristbands in your room, aunt," she explained.
"I must go after them, and I'll just go up and finish this nightgown
there."
There were four rooms up-stairs, with a hall running between each
two. The two on the left were occupied by Miss Henderson, one
being her bedroom, the other a bath-room. Mrs. Hill had the room
opposite the heiress, the other being used by Rosie, the
chambermaid.
Miss Clowrie (one hates to tell it, but what is to be done?) went
deliberately to Miss Henderson's door, and applied first her eye, then
her ear, to the key-hole. Applying her eye, she distinctly beheld Miss
Olive Henderson, the heiress of Redmon, the proudest woman she
had ever known, down upon her knees, before Miss Rose, the
governess—the ex-school-mistress; holding up her closed hands, in
wild supplication, her face like the face of a corpse, and all her black
hair tumbled and falling about her.
To say that Miss Catty Clowrie was satisfied by this sight, would be
doing no sort of justice to the subject. The first words she caught
were not likely to lessen her astonishment—wild, strange words.
"I thought you were dead! I thought you were dead!" in a passion of
consternation, that seemed to blot out every thought of prudence. "I
thought you were dead! As Heaven hears me, I thought you were
dead, or I never would have done it."
Miss Rose was standing with her back to the door, and the
eavesdropper saw her trying to raise the heiress up.
"Get up, Harriet," she distinctly heard her say, though she spoke in a
low voice; "I cannot bear to see you like this; and do not speak so
loud—some one may hear you."
If they had only known of the pale listener at the door, hushing her
very heart-beating to hear the better. But Miss Henderson would not
rise; she only knelt there, white and wild, and holding up her
clasped hands.
"I will never get up," she passionately cried. "I will never rise out of
this until you promise to keep my secret. It is not as a favor, it is as
a right I demand it! Your father robbed my mother and me. But for
him I would have never known poverty and misery—and God only
knows the misery that has been mine. But for him, I should never
have known what it is to suffer from cold and hunger, and misery
and insult; but for him I would have been rich to-day; but for him
my mother might still be alive and happy. He ruined us, and broke
her heart, and I tell you it is only justice I ask! I should never have
come here had I not thought you dead; but now that I have come,
that wealth and comfort have been mine once more, I will not go. I
will not, I tell you! I will die before I yield, and go back to that
horrible life, and may my death rest forever on your soul!"
Catty Clowrie, crouching at the door, turned as cold as death,
listening to these dreadful words. Was she awake—was she
dreaming? Was this Olive Henderson—the proud, the beautiful, the
queenly heiress—this mad creature, uttering those passionate,
despairing words. She could not see into the room, her ear was at
the keyhole—strained to a tension that was painful, so absorbed was
she in listening. But at this very instant her strained hearing caught
another sound—Rosie, the chambermaid, coming along the lower
hall, and up-stairs. Swift as a flash, Catty Clowrie sprang up, and
darted into her aunt's room. She did not dare to close the door, lest
the girl should hear her, and she set her teeth with anger and
suppressed fury at the disappointment.
Rosie had come up to make her bed, and set her room to rights, and
was in no wise disposed to hurry over it. She sang at her work; but
the pale-faced attorney's daughter in the next room, furious with
disappointment, could have seen her choked at the moment with the
greatest pleasure. Half an hour passed—would the girl never go? Yes
—yes, there was Mrs. Hill, at the foot of the stairs, calling her, and
Rosie ran down. Quick as she had left it, Catty was back at her post,
airing her eye at the keyhole once more.
The scene she beheld was not quite so tragic this time. The heiress
and the governess were seated opposite one another, an inlaid table
between them. There was paper and ink on the table; Miss
Henderson held a pen in her hand, as if about to write, and Miss
Rose was speaking. Her voice was sweet and low, as usual; but it
had a firm cadence, that showed she was gravely in earnest now.
"You must write down these conditions, Harriet," she was saying, "to
make matters sure; but no one shall ever see the papers, and I
pledge you my solemn word, your secret shall be kept inviolable.
Heaven knows I have done all I could to atone for my dead father's
acts, and I will continue to do it to the end. He wronged your
mother and you, I know, and I am thankful it is in my power to do
reparation. I ask nothing for myself—but others have rights as well
as you, Harriet, and as sacred. Two hundred pounds will pay all the
remaining debts of my father now. You must give me that. And you
must write down there a promise to pay Mrs. Marsh one hundred
pounds a year annuity, as long as she lives. Her daughter should
have had it all, Harriet, and neither you nor I; and the least you can
do, in justice, is to provide for her. You will do this?"
"Yes—yes," Miss Henderson cried; "that is not much to do! I want to
do more. I want you to share with me, Olly."
"No," said Miss Rose, "you may keep it all. I have as much as I want,
and I am very well contented. I have no desire for wealth. I should
hardly know what to do with it if I had possessed it."
"But you will come and live with me," Miss Henderson said, in a
voice strangely subdued; "come and live with me, and let us share it
together, as sisters should."
That detestable housemaid again! If Catty Clowrie had been a man,
she might have indulged in the manly relief of swearing, as she
sprang up a second time, and fled into Mrs. Hill's room. This time,
Rosie was not called away, and she sat for nearly an hour, singing, at
her chamber window, and mending her stockings. Catty Clowrie, on
fire with impotent fury, had to stay where she was.
Staying there, she saw Miss Henderson's door opened at last; and,
peeping cautiously out, saw the two go down-stairs together. Miss
Rose looked as if she had been crying, and her face was very pale,
but the fierce crimson of excitement burned on the dark cheeks and
flamed in the black eyes of Miss Henderson. It was the heiress who
let Miss Rose out, and then she came back to her room, and
resumed the old trick of walking up and down, up and down, as on
the preceding night.
Catty wondered if she would never be tired. It was all true, then;
and there was a dark secret and mystery in Olive Henderson's life.
"Olive!" Was that her name, and if so, why had Miss Rose called her
"Harriet." And if the governess's name was Winnie, why did the
heiress call her "Olly?"
Catty Clowrie sat thinking while the April day faded into misty
twilight, and the cold evening star glimmered down on the sea. She
sat there thinking while the sun went low, and dipped into the bay,
and out of sight. She sat thinking while the last little pink cloud of
the sunset paled to dull gray, and the round white moon came up,
like a shining shield. She sat there thinking till the dinner-bell rang,
and she remembered she was cold and hungry, and went slowly
down-stairs—still thinking.
To her surprise, for she had been too absorbed to hear her come out
of her room, Miss Henderson was there, beautifully dressed, and in
high spirits. She had such a passion for luxury and costly dress, this
young lady, that she would array herself in velvets and brocades,
even though there were none to admire her but her own servants.
On this evening, she had dressed herself in white, with ornaments of
gold and coral in her black braids, broad gold bracelets on her
superb arms, and a cluster of scarlet flowers on her breast. She
looked so beautiful with that fire in her eyes, that flush on her
cheek, that brilliant smile lighting up her gypsy face, that Mrs. Hill
and Catty were absolutely dazzled. She laughed—a clear, ringing
laugh—at Mrs. Hill's profuse congratulations on her magical recovery.
"You dear old Mrs. Hill!" she said, "when you are better used to mo,
you will cease to wonder at my eccentricities! It is a woman's
privilege to change her mind sixty times an hour, if she chooses—
and I choose to assert all the privileges of my sex!"
She rose from the table as she spoke, still laughing, and went into
the drawing-room. The gas burned low, but she turned it up to its
full flare, and, opening the piano, rattled off a stormy polka. She
twirled round presently, and called out:
"Mrs. Hill!"
Mrs. Hill came in.
"Tell Sam to go up to Miss Blair's, and fetch her here. Let him tell her
I feel quite well again, and want her to spend the evening, if she is
not engaged. He can take the gig, and tell him to make haste, Mrs.
Hill."
Mrs. Hill departed on her errand, and Miss Henderson's jeweled
fingers were flying over the polished keys once more. Presently she
twirled around again, and called out: "Miss Clowrie."
"I wish Laura would come!" Miss Henderson said, pulling out her
watch, "and I wish she would fetch a dozen people with her. I feel
just in the humor for a ball to-night."
She talked to Catty Clowrie vivaciously, and to Mrs. Hill, because she
was just in the mood for talking, and rattled off brilliant sonatas
between whiles. But she was impatient for Laura's coming, and kept
jerking out her watch every five minutes, to look at the hour.
Miss Blair made her appearance at last, and not alone. There was a
gentleman in the background, but Miss B. rushed with such a frantic
little scream of delight into the arms of her "dear, darling Olly," and
so hugged and kissed her, that, for the first moment or two, it was
not very easy to see who it was. Extricating herself, laughing and
breathless, from the gushing Miss Blair, Olive looked at her
companion, and saw the amused and handsome face of Captain
Cavendish.
"I hope I am not an intruder," that young officer said, coming
forward, "but being at Mr. Blair's when your message arrived, and
hearing you were well again, I could not forbear the pleasure of
congratulating you. The Princess of Speckport can be ill dispensed
with by her adoring subjects."
Some one of Miss Henderson's innumerable admirers had dubbed
her "Princess of Speckport," and the title was not out of place. She
laughed at his gallant speech, and held out her hand with frank
grace.
"My friends are always welcome," she said, and here she was
interrupted by a postman's knock at the door.
"Dear me! who can this be?" said Mrs. Hill, looking up over her
spectacles, as Rosie opened the door.
It proved to be Mr. Val Blake. That gentleman being very busy all
day, had found no time to inquire for Miss Henderson, until after tea,
when, strolling out, with his pipe in his mouth, for his evening
constitutional, he had stepped around to ask Mrs. Hill. Miss
Henderson appeared in person to answer his friendly inquiries, and
Mr. Blake came in, nothing loth, and joined the party.
Some one proposed cards, after a while; and Mr. Blake, and Miss
Blair, and Mrs. Hill, and Miss Clowrie, gathered round a pretty little
card-table, but Miss Henderson retained her seat at the piano,
singing, and playing operatic overtures. Captain Cavendish stood
beside her, turning over her music, and looking down into the
sparkling, beautiful face, with passionately loving eyes. For the spell
of the sorceress burdened him more this night than ever before, and
the man's heart was going in great plunges against his side. He
almost fancied she must hear its tumultuous beating, as she sat
there in her beauty and her pride, the red gold gleaming in her black
braids and on her brown arms. It had always been so easy before
for him to say what was choking him now, and he had said it often
enough, goodness knows, for the lesson to be easy. But there was
this difference—he loved this black-eyed sultana; and the fever
called love makes a coward of the bravest of men. He feared what
he had never feared before—a rejection; and a rejection from her,
even the thought of one, nearly sent him mad.
And all this while Miss Olive Henderson sat on her piano-stool, and
sang "Hear me, Norma," serenely unconscious of the storm going on
in the English officer's breast. He had heard that very song a
thousand times better sung, by Nathalie Marsh. Ah! poor forgotten
Nathalie!—but he was not listening to the singing. For him, the
circling sphere seemed momentarily standing still, and the business
of life suspended. He was perfectly white in his agitation, and the
hand that turned the leaves shook. His time had come. The card-
party were too much absorbed in scoring their points to heed them,
and now, or never, he must know his fate. What he said he never
afterward knew—but Miss Henderson looked strangely startled by his
white face and half incoherent sentences. The magical words were
spoken; but as the self-possessed George Cavendish had never
spoken thus before, and the supreme question, on which his life's
destiny hung, asked.
The piano stood in a sort of recess, with a lace-draped window to
the right, looking out upon Golden Row. Miss Henderson sat, all the
time he was speaking, looking straight before her, out into the coldly
moonlit street. Not once did her color change—no tremor made the
scarlet flowers on her breast rise and fall—no flutter made the misty
lace about her tremble. She was only very grave, ominously grave,
and the man's heart turned sick with fear, as he watched her
unchanging face and the dark gravity of her eyes. She was a long
time in replying—all the while sitting there so very still, and looking
steadfastly out at the quiet street; not once at him. When she did
reply, it was the strangest answer he had ever received to such a
declaration. The reply was another question.
"Captain Cavendish," she said, "I am an heiress, and you—pardon
me—have the name of a fortune-hunter. If I were penniless, as I
was before this wealth became mine—if by some accident I were to
lose it again—would you say to me what you have said now?"
Would he? The answer was so vehement, so passionate, that the
veriest skeptic must have believed. His desperate earnestness was
written in every line of his agitated face.
"I believe you," she said; "I believe you, Captain Cavendish. I think
you do love me; but I—I do not love you in return."
He gave a sort of cry of despair, but she put up one hand to check
him.
"I do not love you," she steadily repeated, "and I have never loved
any one in this way. Perhaps it is not in me, and I do not care that it
should be: there is misery enough in the world, Heaven knows,
without that! I do not love you, Captain Cavendish, but I do not love
any one else. I esteem and respect you; more, I like you: and if you
can be content with this, I will be your wife. If you cannot, why, we
will be friends as before, and——"
But he would not let her finish. He had caught her hand in his, and
broke out into a rhapsody of incoherent thanks and delight.
"There, there!" she smilingly interposed, "that will do! Our friends at
the card-table will hear you. Of one thing you may be certain: I shall
be true to you until death. Your honor will be safe in my hands; and
this friendly liking may grow into a warmer feeling by-and-by. I am
not very romantic, Captain Cavendish, and you must not ask me for
more than I can give."
But Captain Cavendish wanted no more. He was supremely blessed
in what he had received, and his handsome face was radiant.
"My darling," he said, "I ask for no more! I shall think the devotion
of a whole life too little to repay you for this."
"Very well," said Miss Henderson, rising; "and now, after that pretty
speech, I think we had better join our friends, or my duty as hostess
will be sadly neglected."
She stood behind Miss Laura Blair for the rest of the evening,
watching the fluctuations of the game, and with no shadow of
change in her laughing face. She stood there until the little party
broke up, which was some time after ten, when Mr. Blair called
around for Laura himself. Miss Laura was not to say over and above
obliged to her pa for this act of paternal affection—since she would
have infinitely preferred the escort of Mr. Blake. That gentleman
hooked his arm within that of Captain Cavendish, and bade Miss
Blair good-night, with seraphic indifference.
Miss Henderson's bedroom windows commanded an eastward view
of the bay, and when she went up to her room that night, she sat for
a long time gazing out over the shining track the full moon made for
herself on the tranquil sea. "Gaspereaux month" had come around
again, and the whole bay was dotted over with busy boats. She
could see the fishermen casting their nets, now in the shadow, now
in the glittering moonlight, and the peaceful beauty of the April night
filled her heart with a deep, sweet sense of happiness. Perhaps it
was the first time since her arrival in Speckport she had been really
happy—a vague dread and uncertainty had hung over her, like that
fabled sword, suspended by a single hair, and ready to fall at any
moment. But the fear was gone, she was safe now—her inheritance
was secure, and she was the promised wife of an honorable
gentleman. Some day, perhaps, he might be a baronet, and she "my
lady," and her ambitious heart throbbed faster at the thought. She
sat there, dreaming and feeling very happy, thinking of the double
compact ratified that most eventful day, but she never once thanked
God—never gave one thought to him to whom she owed it all. She
sat there far into the night, thinking, and when she laid her head on
the pillow and fell asleep, it was to act it all over in dreamland again.
Some one else lay awake a long time that night, thinking, too. Miss
Clowrie, in the opposite chamber, did not sit up by the window; Mrs.
Hill would, no doubt, not have permitted it, and Miss Clowrie was a
great deal too sensible a person to run the risk of catching cold. But,
though she lay with her eyes shut she was not asleep, and Olive
Henderson might not have dreamed quite such happy dreams had
she known how dark and ominous were the thoughts the attorney's
pale daughter was thinking.
CHAPTER XXVI.
MR. PAUL WYNDHAM.
On the morning after the day fraught with so many events to the
heiress of Redmon, the mother of the late heiress sat in the sitting-
room of her pleasant seaside home, reading a novel. The firelight
shone on her mourning-dress, but the inward mourning was not very
profound. She had cried a good deal at first for the loss of her son
and daughter; she cried sometimes still when people talked to her
about them; but she cried quite as much over the woes of her pet
heroes and heroines, bound in paper and cloth, and slept just as
soundly, and took her meals with as good a relish as ever she had
done in her life. Mrs. Marsh was not greatly given to borrowed
trouble; she took the goods the gods provided, and let to-morrow
take care of itself, so long as she had enough for to-day. Mr. Val
Blake paid the butcher's, and baker's, and grocer's bills quarterly;
settled with Betsy Ann, and Miss Jo saw that she was well dressed;
and Mrs. Marsh took all as a matter of course, and I don't think even
once thanked Mr. Blake for his kindness.
On this sunny spring morning Mrs. Marsh sat comfortably reading, so
absorbed in her book as to be out of the reach of all mundane
affairs. The book had a bright yellow cover, with a striking engraving
of one man grasping another by the throat, and presenting a pistol
at his head, and was called the "Red Robber of the Rocky
Mountains"—a sequel to the "Black Brigand,"—when, just in the
middle of a most thrilling chapter, Mrs. Marsh was disturbed by a
knock at the front door. Betsy Ann answered the summons, and
stood transfixed at the shining apparition she beheld. A beautiful
young lady, with big black eyes, that shone on Betsy Ann like two
black diamonds, arrayed in rustling silk, and a rich creamy crape
shawl, with a bonnet fine enough for the queen of England, stood
before her, asking, in a silvery voice, if Mrs. Marsh were at home.
Standing before the door was a small open carriage, drawn by two
milk-white ponies; and Miss Laura Blair sat within, nodding
pleasantly to her, Betsy Ann, and holding the reins. The girl, quite
dazzled by the splendor of this early visitor, ushered the radiant
vision into the room where her mistress sat, and Mrs. Marsh arose
with an exclamation of surprise she could not repress. They had met
a few times before at the houses of mutual friends, but this was the
young lady's first call.
"Miss Henderson," Mrs. Marsh stammered, utterly at a loss what to
say—"I am sure I am very glad to see you; I have not had many
visitors of late."
Tears rose to her eyes as she spoke, with the thoughts of the
pleasant days gone by, when the friends of Nathalie and Charley, the
friends of their prosperity, had made the cottage more gay with
laughter and music. Miss Henderson was not looking at her, but into
the red coal-fire.
"I have come on a little matter of business, Mrs. Marsh," she said. "I
have come to fulfill a duty I owe to you. I know the story of the
past, and, I am afraid, you must feel in some degree as if I had
taken from you what should have been yours. Your—your daughter
had no doubt a prior claim to what I now possess, and common
justice requires you should not be defrauded. I am aware of Mr.
Blake's great generosity, but the duty—and, I assure you, it is a
pleasure to me—lies with me, not with him. I have, therefore,
settled upon you, for life, an annuity of one hundred pounds per
annum, which will be paid to you at my banker's, monthly or
quarterly, as you may prefer. It was to say this I came so early this
morning, but, if you will permit me, this visit shall be but the
forerunner of many others."
She was standing up as she finished, with a look of intense relief at
having accomplished her task, and Mrs. Marsh altogether too dazed
and bewildered to utter a word.
"And I shall be very, very happy, my dear Mrs. Marsh," the heiress
said, bending over her, and taking her hand, "if you will sometimes
come up and see me. I have no mother, and I will look upon you as
such, if you will let me."
Mrs. Marsh saw her go, feeling as though she were in a dream, or
acting a chapter out of one of her own romances.
Miss Henderson took her place beside Laura in the pony carriage,
and they drove slowly along Cottage Street, looking at the broad
blue bay, sparkling in the sunshine, as if sown with stars. The beach,
with its warm, white sands, edged the sea like a silver streak; and
the waves sang their old music, as they crept up on its breast.
"How beautiful it all is!" the heiress cried, her dark face lighting up
as it always did at sight of the ocean. "Let us get out, Laura; I could
stay here listening to those sailors singing forever."
There were some idle boys at play on an old wharf, overgrown with
moss and slimy seaweed, its tarry planks rotting in the sun.
Miss Henderson dropped a bright silver shilling into the dirty palm of
one, and asked him to hold the ponies for ten minutes; and the two
girls walked along the decaying and deserted old wharf together.
"My solemn Laura!" the heiress said, looking at her friend's grave
face; "what a doleful countenance you wear! Of what are you
thinking?"
"I am thinking of poor Nathalie Marsh," Laura answered; "it was on
this very wharf she met her death, that wild, windy night. I have
never been near the place since."
It is a remarkable trait of these swarthy faces that emotion does not
pale them as it does their blonde neighbors—they darken. Miss
Henderson's face darkened now—it always seemed to do so when
the name of the dead girl was mentioned. She turned away from her
friend, and stood staring moodily out to sea, until an exclamation
from that young lady caused her to turn round and perceive that
either the sea-wind or some other cause had very perceptibly
heightened Miss Blair's color.
"I declare if that's not Val," Laura cried, "and that strange gentleman
with him that came from New York the other day. There! they see
us, and are coming here."
Miss Henderson looked indifferently as Mr. Blake and his friend
approached. Val introduced his companion to the ladies as Mr. Paul
Wyndham, of New York, and that gentleman was received graciously
by Miss Blair, and coldly, not to say haughtily, by Miss Henderson.
The heiress did not like people from New York. She never talked
about that city, if she could help it, and rather avoided all persons
coming from it. She stood, looking vacantly out at the wide sea, and
listening to the sailors' song, taking very little part in the
conversation. She turned round, when the singing ceased, in the
direction of her carriage, with a listless yawn she was at little trouble
to suppress, and a bored look she took no pains to conceal. The
gentlemen saw them safely off, and then loitered back to the old
wharf.
"Well, Wyndham," Val asked, "and what do you think of the Princess
of Speckport?"
Mr. Paul Wyndham did not immediately reply. He was leaning lazily
against a rotten beam, lighting a cigar, for he was an inveterate
smoker.
Mr. Wyndham was not handsome, he was not dashing—he had
neither mustache nor whisker, nor an aquiline nose; and he could
not dance or sing, or do anything else like any other young Christian
gentleman. He was very slight and boyish of figure, with a pale,
student-like face, a high forehead, deep-set eyes, a characteristic
nose, and a thin and somewhat cynical mouth. There was character
in everything about him, even in the mathematical precision of his
dress, faultlessly neat in the smallest particular, and scrupulously
simple. He looked like a gentleman and a student, and he was both.
More, he was an author, a Bohemian, with a well-earned literary
fame, at the age of seven-and-twenty. When he was a lad of
seventeen he had started with his "knapsack on his back,"
containing a clean shirt, and a quire of foolscap, and had traveled
through Europe and Asia, and had written two charming books of
travel, that filled his pockets with dollars, and established his fame
as an author. Since then he had written some half-dozen delightful
novels, over which Laura Blair herself had cried and laughed
alternately, although she did not know now that Mr. Wyndham and
—— —— were one and the same. He had written plays that had run
fifty nights at a time, and his sketches were the chief charm of one
or two of the best American magazines. He was a poet, an author, a
dramatist, sometimes an actor, when he took the notion, and a
successful man in all. He looked as those inspired men who chain us
with their wonderful word-painting should look, albeit I reiterate he
was not handsome. He stood now leaning against the rotten beam,
smoking his cigar, and looking dreamily over the shining sea, while
Mr. Blake repeated his question.
"I say, Wyndham, how do you like her—the beauty, the belle, the
Princess of Speckport?"
"She is a fine-looking girl," Mr. Wyndham quietly replied. "And those
big black eyes of hers are very handsome, indeed. It strikes me I
should like to marry that girl!"
"Yes," said Mr. Blake, composedly, "I dare say. I know several other
gentlemen in Speckport who would like to do the same thing, only
they can't, unfortunately."
"Can't they? Why?"
"Because there is an absurd law against bigamy in this province, and
the young lady has promised to marry one man already."
"Ah! who is he?"
"Captain Cavendish. You met him yesterday, you remember. He
proposed the other night at the house, and told me about it coming
home. She accepted him; but the affair has not yet been made
public, by the lady's express desire."
Mr. Wyndham took out his cigar, knocked off the ashes with the end
of his little finger, and replaced it.
"Captain Cavendish is a lucky fellow," he said. "But yet I don't
despair. Until the wedding-ring actually slips over the lady's finger,
there is room for hope."
"But, my dear fellow, she is engaged."
"C'est bien! There is many a slip. I don't believe she will ever be Mrs.
Cavendish."
Mr. Blake stared at his friend; but that gentleman looked the very
picture of calm composure.
"My dear Wyndham," Mr. Blake remarked, compassionately, "you are
simply talking nonsense. I know you are very clever, and famous,
and all that sort of thing, and brain is excellent in its way; but I tell
you it has no chance against beauty."
"By which you would imply, I stand no chance against Captain
Cavendish. Now, if you'll believe me, I am not so sure of that. I
generally manage to accomplish whatever I set my heart upon; and
I don't think—I really don't, old boy—that I shall fail in this. Besides,
if it does come to beauty, I am not such a bad-looking fellow, in the
main."
To say that Mr. Blake stared after hearing this speech would be but a
feeble description of the open-mouthed-and-eyed gape with which
he favored its deliverer. To do Mr. Wyndham justice, he was that
phenomenon not often seen—a modest author. He never bored his
enemy about "My last book, sir!" he never alluded to his literary
labors at all, unless directly spoken to on the subject; and certainly
had never before displayed any vanity. Therefore, Mr. Blake stared,
not quite decided whether he had heard aright; and Mr. Wyndham,
seeing the look, did what he did not often do, burst out laughing.
"My dear old Val," he cried, slapping him on the shoulder, "I have
not lost my senses; so there is no need of that look. I should like to
have a tall wife—small men always do, you know—with black eyes
and two hundred thousand dollars; and I shall enter the lists with
this fascinating Captain Cavendish, and bear off the prize if I can, in
spite of his sword, and uniform, and handsome face. I think, on the
whole, I shall make the young lady quite as good a husband as he."
"Well," said Mr. Blake, drawing a long breath, and appealing to the
deep, "for cool impudence and self-conceit, Paul Wyndham hasn't his
match in broad America. Here he comes from New York; and before
he is a week in the place he talks of marrying the richest and
handsomest girl it contains, as coolly as if he were Sultan of all
Turkey, and she a Circassian slave. Yes, Mr. Wyndham, ask her, by all
means, and when you get your conge, let me know—it will be one of
the happiest days of my life."
"But I don't think I shall get my conge" persisted Paul Wyndham.
"Do you know if she is in love with this Captain Cavendish?"
"I never asked her," responded Mr. Blake. "I leave that for Mr.
Wyndham to ascertain."
"Because I don't think she is," went on his friend. "When she stood
here a few minutes ago, you and the other young lady, Miss—what's
her name?—were talking of the gallant captain, and she listened
with a face of perfect indifference. I was watching her, and I don't
think she cares about him."
"I saw you watching her," said Val, "and so did she, and I don't think
she liked it. I saw those black brows of hers contract once or twice,
and that is an ominous sign with Miss Henderson."
"Miss Henderson could fly into a dickens of a passion, too, if she
liked. Your black-eyed, black-haired, brown-skinned women raise the
very old diable herself, if you stroke them the wrong way. They are
something like big black cats. I tell you, Blake, I don't believe she
cares about that military popinjay, Cavendish."
"Don't you," said Mr. Blake, with his hands in his pockets. "Of course,
if you say so it must be so."
"No; but I really think so. Are his family anything in England?"
"It is currently believed he is next heir to a baronetcy. But the
baronet got married in his old days, and there is a little shaver in
petticoats to cut Master George out. Still, he lives in hope. The new
baronet has the measles and the mumps, and the whooping-cough,
and the scarlatina, and the chicken-pox, and a tribe of other
diseases, his teeth included, to struggle through, before he reaches
man's estate. There is no telling but Cavendish may be a baronet
yet."
"That is it, then!" said Wyndham. "It is for his prospective baronetcy
the girl has promised to marry him. Pride and ambition, the two sins
that hurled Lucifer from heaven to hell, are strong in that woman."
"Oh, come now," said Val, starting up, "I think we had better get out
of this, and drop the subject. It strikes me your language is rather
forcible, Mr. Wyndham; and there is no telling what you may work
yourself up to, if you keep on. It wouldn't be healthy for you, I'm
thinking, if Miss Henderson heard you."
"Nevertheless," Paul Wyndham persisted, flinging away his smoked-
out weed, "I shall marry Miss Henderson."
The two friends walked away together to the office in Queen Street
—Mr. Blake disdaining all reply to the last remark.
On their way they met Captain Cavendish, mounted on his favorite
bay, and looking the very beau ideal of a military rider, slowly
cantering beside the pretty pony-carriage where the Princess of
Speckport sat in state. The contrast between the handsome officer
on horseback and the young author on foot was great; but Mr.
Wyndham bowed to the soldier and his fair friends with undisturbed
placidity.
"You see!" said Mr. Blake, significantly.
"I see," serenely answered Mr. Wyndham; "and I repeat. I shall
marry Miss Olive Henderson!"
There was nothing at all of boasting in the tone of Mr. Paul
Wyndham in saying this—simply one of deep, quiet determination.
You had only to look at his face—that pale, steadfast face—if you
were any judge of physiognomy, to perceive that his assurance to
Mr. Blake, of seldom failing in any undertaking, was no idle bravado.
He was one of those men of iron inflexibility, of invincible daring, of
over mastering strength of will, bending all other wills to their own.
Men of the Napoleon Bonaparte stamp, made to sway empires, and
move about other men, kings and knights, queens and bishops, as
they please, on the great chessboard of life. Mr. Val Blake, knowing
Paul Wyndham, had some dim perception of this; but he knew, too,
that Olive Henderson was no ordinary woman. He had a strong will,
and so had she; but it was only a woman's will after all, and with it
went womanly weakness, passion, and impulse, and the calm,
passionless man was the master-mind.
"But I think she will baffle him here, after all," Mr. Blake said to
himself, as he ceased thinking about the matter. "I don't believe
Olive Henderson will ever marry Paul Wyndham, not but what he's a
great deal better fellow than Cavendish, after all!"
It seemed as though he was right, for a whole week passed before
Mr. Wyndham and Miss Henderson met again. The engagement of
the heiress with Captain Cavendish, though not formally announced,
was pretty generally known; and it was rumored that the wedding
was to take place early in June. May had come in, draped in a
sodden sheet of gray wet fog; but the villa at Redmon went steadily
up, despite of wind and weather. Landscape-gardeners were turning
the potato-patches and broad meadows and turnip-fields into a little
heaven below, and the place was to be completed in July, when Mrs.
Grundy said the happy pair would be returning from their bridal-tour,
and take up their abode therein.
Mr. Paul Wyndham heard all this as he smoked his cigars and wrote
away placidly at his new novel, and was in nowise disturbed. Mr. Val
Blake heard it, and grinned as he thought of the egotistical young
author getting baffled for once. Miss Henderson's innumerable
admirers heard it, and gnashed their teeth with impotent, jealous
fury, and, lastly, Miss Henderson herself heard it, and frowned and
laughed alternately.
"This horrid gossiping town of yours, Laura!" she said impatiently;
"how do they find out everything as soon as one knows it one's self,
I wonder! I wish people would mind their own business and let me
alone!"
"Great people must pay the penalty of greatness, my dear," Miss
Blair answered, philosophically; "and, besides, it is only a question of
time, so don't get into a gale about it! It doesn't matter much
whether it is known this minute or the next."
The conversation between the young ladies took place in Miss
Henderson's room, and while dressing for a ball. It was to be a very
grand ball indeed, given by the officers, and to which only the tiptop
cream of the cream of Speckport society was to be invited. Of course
Miss Henderson was the first lady thought of, and of course her
friend Miss Blair came next; but Mr. Val Blake, who didn't belong to
the crême at all, was to be there too. But Mr. Blake was such a good
fellow, and hand and glove with the whole barracks, and was so
useful to puff their concerts and theatricals in the "Spouter," and
praise the bass of Lieutenant the Honorable L. H. Blank, and the
tenor-solo of Captain G. P. Cavendish, etc., etc., that it would have
been an unpardonable breach to have omitted him. Mr. Paul
Wyndham, whose fame as an author had by this time reached
Speckport, was also to be there; and the ball was expected to be the
most brilliant thing of the season.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com