0% found this document useful (0 votes)
22 views

Programming Language Design Concepts 1st Edition Findlay download

The document provides information about various programming language design concepts, including types, variables, bindings, and procedural abstraction. It includes references to multiple related books and resources for further reading. The content is structured into parts covering introductory, basic, and advanced concepts in programming languages.

Uploaded by

sabiteanjeze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Programming Language Design Concepts 1st Edition Findlay download

The document provides information about various programming language design concepts, including types, variables, bindings, and procedural abstraction. It includes references to multiple related books and resources for further reading. The content is structured into parts covering introductory, basic, and advanced concepts in programming languages.

Uploaded by

sabiteanjeze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Programming Language Design Concepts 1st Edition

Findlay download

https://ebookname.com/product/programming-language-design-
concepts-1st-edition-findlay/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Java Programming Exercises Volume One Language


Fundamentals and Core Concepts 1st Edition Christian
Ullenboom

https://ebookname.com/product/java-programming-exercises-volume-
one-language-fundamentals-and-core-concepts-1st-edition-
christian-ullenboom/

Programming Language Foundations 1st Edition Aaron


Stump

https://ebookname.com/product/programming-language-
foundations-1st-edition-aaron-stump/

MIPS Assembly Language Programming Robert Britton

https://ebookname.com/product/mips-assembly-language-programming-
robert-britton/

Renin Angiotensin System and Cardiovascular Disease 1st


Edition Walmor C. Demello Md

https://ebookname.com/product/renin-angiotensin-system-and-
cardiovascular-disease-1st-edition-walmor-c-demello-md/
Computer Viruses For Dummies Peter H. Gregory

https://ebookname.com/product/computer-viruses-for-dummies-peter-
h-gregory/

Ágrip af Nóregskonungas■gum A Twelfth Century Synoptic


History of the Kings of Norway 2nd Revised Edition
Matthew James Driscoll

https://ebookname.com/product/agrip-af-noregskonungas%c7%abgum-a-
twelfth-century-synoptic-history-of-the-kings-of-norway-2nd-
revised-edition-matthew-james-driscoll/

Buddhist Public Advocacy and Activism in Thailand A


Rhetoric of Dignity and Duty 2024th Edition Craig M.
Pinkerton

https://ebookname.com/product/buddhist-public-advocacy-and-
activism-in-thailand-a-rhetoric-of-dignity-and-duty-2024th-
edition-craig-m-pinkerton/

Historical Linguistics 2005 Selected Papers from the


17th International Conference on Historical Linguistics
Madison Wisconsin 31 July 5 August 2005 1st Edition
Joseph C. Salmons
https://ebookname.com/product/historical-
linguistics-2005-selected-papers-from-the-17th-international-
conference-on-historical-linguistics-madison-
wisconsin-31-july-5-august-2005-1st-edition-joseph-c-salmons/

Critical Companion to T S Eliot A Literary Reference to


His Life and Work 1st Edition Russell Elliott Murphy

https://ebookname.com/product/critical-companion-to-t-s-eliot-a-
literary-reference-to-his-life-and-work-1st-edition-russell-
elliott-murphy/
Atoms and materials 1st Edition Kyle

https://ebookname.com/product/atoms-and-materials-1st-edition-
kyle/
PROGRAMMING LANGUAGE
DESIGN CONCEPTS
PROGRAMMING LANGUAGE
DESIGN CONCEPTS

David A. Watt, University of Glasgow


with contributions by

William Findlay, University of Glasgow


Copyright  2004 John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester,
West Sussex PO19 8SQ, England

Telephone (+44) 1243 779777

Email (for orders and customer service enquiries): [email protected]


Visit our Home Page on www.wileyeurope.com or www.wiley.com

All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in
any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except under
the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright
Licensing Agency Ltd, 90 Tottenham Court Road, London W1T 4LP, UK, without the permission in writing of the
Publisher, with the exception of any material supplied specifically for the purpose of being entered and executed
on a computer system for exclusive use by the purchase of the publication. Requests to the Publisher should be
addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West
Sussex PO19 8SQ, England, or emailed to [email protected], or faxed to (+44) 1243 770620.

This publication is designed to provide accurate and authoritative information in regard to the subject matter
covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If
professional advice or other expert assistance is required, the services of a competent professional should be sought.

ADA is a registered trademark of the US Government Ada Joint Program Office.

JAVA is a registered trademark of Sun Microsystems Inc.

OCCAM is a registered trademark of the INMOS Group of Companies.

UNIX is a registered trademark of AT&T Bell Laboratories.

Other Wiley Editorial Offices

John Wiley & Sons Inc., 111 River Street, Hoboken, NJ 07030, USA

Jossey-Bass, 989 Market Street, San Francisco, CA 94103-1741, USA

Wiley-VCH Verlag GmbH, Boschstr. 12, D-69469 Weinheim, Germany

John Wiley & Sons Australia Ltd, 33 Park Road, Milton, Queensland 4064, Australia

John Wiley & Sons (Asia) Pte Ltd, 2 Clementi Loop #02-01, Jin Xing Distripark, Singapore 129809

John Wiley & Sons Canada Ltd, 22 Worcester Road, Etobicoke, Ontario, Canada M9W 1L1

Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic books.

Library of Congress Cataloging-in-Publication Data

Watt, David A. (David Anthony)


Programming language design concepts / David A. Watt ; with
contributions by William Findlay.
p. cm.
Includes bibliographical references and index.
ISBN 0-470-85320-4 (pbk. : alk. paper)
1. Programming languages (Electronic computers) I. Findlay, William,
1947- II. Title.

QA76.7 .W388 2004


005.13 – dc22
2003026236
British Library Cataloguing in Publication Data

A catalogue record for this book is available from the British Library

ISBN 0-470-85320-4

Typeset in 10/12pt TimesTen by Laserwords Private Limited, Chennai, India


Printed and bound in Great Britain by Biddles Ltd, King’s Lynn
This book is printed on acid-free paper responsibly manufactured from sustainable forestry
in which at least two trees are planted for each one used for paper production.
To Carol
Contents

Preface xv

Part I: Introduction 1
1 Programming languages 3
1.1 Programming linguistics 3
1.1.1 Concepts and paradigms 3
1.1.2 Syntax, semantics, and pragmatics 5
1.1.3 Language processors 6
1.2 Historical development 6
Summary 10
Further reading 10
Exercises 10

Part II: Basic Concepts 13


2 Values and types 15
2.1 Types 15
2.2 Primitive types 16
2.2.1 Built-in primitive types 16
2.2.2 Defined primitive types 18
2.2.3 Discrete primitive types 19
2.3 Composite types 20
2.3.1 Cartesian products, structures, and records 21
2.3.2 Mappings, arrays, and functions 23
2.3.3 Disjoint unions, discriminated records, and objects 27
2.4 Recursive types 33
2.4.1 Lists 33
2.4.2 Strings 35
2.4.3 Recursive types in general 36
2.5 Type systems 37
2.5.1 Static vs dynamic typing 38
2.5.2 Type equivalence 40
2.5.3 The Type Completeness Principle 42
2.6 Expressions 43
2.6.1 Literals 43
2.6.2 Constructions 44
2.6.3 Function calls 46
2.6.4 Conditional expressions 47
2.6.5 Iterative expressions 48
2.6.6 Constant and variable accesses 49

vii
viii Contents

2.7 Implementation notes 49


2.7.1 Representation of primitive types 49
2.7.2 Representation of Cartesian products 50
2.7.3 Representation of arrays 50
2.7.4 Representation of disjoint unions 51
2.7.5 Representation of recursive types 51
Summary 52
Further reading 52
Exercises 52

3 Variables and storage 57


3.1 Variables and storage 57
3.2 Simple variables 58
3.3 Composite variables 59
3.3.1 Total vs selective update 60
3.3.2 Static vs dynamic vs flexible arrays 61
3.4 Copy semantics vs reference semantics 63
3.5 Lifetime 66
3.5.1 Global and local variables 66
3.5.2 Heap variables 68
3.5.3 Persistent variables 71
3.6 Pointers 73
3.6.1 Pointers and recursive types 74
3.6.2 Dangling pointers 75
3.7 Commands 77
3.7.1 Skips 77
3.7.2 Assignments 77
3.7.3 Proper procedure calls 78
3.7.4 Sequential commands 79
3.7.5 Collateral commands 79
3.7.6 Conditional commands 80
3.7.7 Iterative commands 82
3.8 Expressions with side effects 85
3.8.1 Command expressions 86
3.8.2 Expression-oriented languages 87
3.9 Implementation notes 87
3.9.1 Storage for global and local variables 88
3.9.2 Storage for heap variables 89
3.9.3 Representation of dynamic and flexible arrays 90
Summary 91
Further reading 91
Exercises 92

4 Bindings and scope 95


4.1 Bindings and environments 95
4.2 Scope 97
Contents ix

4.2.1 Block structure 97


4.2.2 Scope and visibility 99
4.2.3 Static vs dynamic scoping 100
4.3 Declarations 102
4.3.1 Type declarations 102
4.3.2 Constant declarations 104
4.3.3 Variable declarations 104
4.3.4 Procedure definitions 105
4.3.5 Collateral declarations 105
4.3.6 Sequential declarations 106
4.3.7 Recursive declarations 107
4.3.8 Scopes of declarations 108
4.4 Blocks 108
4.4.1 Block commands 109
4.4.2 Block expressions 110
4.4.3 The Qualification Principle 110
Summary 111
Further reading 112
Exercises 112

5 Procedural abstraction 115


5.1 Function procedures and proper procedures 115
5.1.1 Function procedures 116
5.1.2 Proper procedures 118
5.1.3 The Abstraction Principle 120
5.2 Parameters and arguments 122
5.2.1 Copy parameter mechanisms 124
5.2.2 Reference parameter mechanisms 125
5.2.3 The Correspondence Principle 128
5.3 Implementation notes 129
5.3.1 Implementation of procedure calls 130
5.3.2 Implementation of parameter mechanisms 130
Summary 131
Further reading 131
Exercises 131

Part III: Advanced Concepts 133


6 Data abstraction 135
6.1 Program units, packages, and encapsulation 135
6.1.1 Packages 136
6.1.2 Encapsulation 137
6.2 Abstract types 140
6.3 Objects and classes 145
6.3.1 Classes 146
6.3.2 Subclasses and inheritance 151
x Contents

6.3.3 Abstract classes 157


6.3.4 Single vs multiple inheritance 160
6.3.5 Interfaces 162
6.4 Implementation notes 164
6.4.1 Representation of objects 164
6.4.2 Implementation of method calls 165
Summary 166
Further reading 167
Exercises 167

7 Generic abstraction 171


7.1 Generic units and instantiation 171
7.1.1 Generic packages in ADA 172
7.1.2 Generic classes in C++ 174
7.2 Type and class parameters 176
7.2.1 Type parameters in ADA 176
7.2.2 Type parameters in C++ 180
7.2.3 Class parameters in JAVA 183
7.3 Implementation notes 186
7.3.1 Implementation of ADA generic units 186
7.3.2 Implementation of C++ generic units 187
7.3.3 Implementation of JAVA generic units 188
Summary 188
Further reading 189
Exercises 189

8 Type systems 191


8.1 Inclusion polymorphism 191
8.1.1 Types and subtypes 191
8.1.2 Classes and subclasses 195
8.2 Parametric polymorphism 198
8.2.1 Polymorphic procedures 198
8.2.2 Parameterized types 200
8.2.3 Type inference 202
8.3 Overloading 204
8.4 Type conversions 207
8.5 Implementation notes 208
8.5.1 Implementation of parametric polymorphism 208
Summary 210
Further reading 210
Exercises 211

9 Control flow 215


9.1 Sequencers 215
9.2 Jumps 216
9.3 Escapes 218
Contents xi

9.4 Exceptions 221


9.5 Implementation notes 226
9.5.1 Implementation of jumps and escapes 226
9.5.2 Implementation of exceptions 227
Summary 227
Further reading 228
Exercises 228

10 Concurrency 231
10.1 Why concurrency? 231
10.2 Programs and processes 233
10.3 Problems with concurrency 234
10.3.1 Nondeterminism 234
10.3.2 Speed dependence 234
10.3.3 Deadlock 236
10.3.4 Starvation 237
10.4 Process interactions 238
10.4.1 Independent processes 238
10.4.2 Competing processes 238
10.4.3 Communicating processes 239
10.5 Concurrency primitives 240
10.5.1 Process creation and control 241
10.5.2 Interrupts 243
10.5.3 Spin locks and wait-free algorithms 243
10.5.4 Events 248
10.5.5 Semaphores 249
10.5.6 Messages 251
10.5.7 Remote procedure calls 252
10.6 Concurrent control abstractions 253
10.6.1 Conditional critical regions 253
10.6.2 Monitors 255
10.6.3 Rendezvous 256
Summary 258
Further reading 258
Exercises 259

Part IV: Paradigms 263

11 Imperative programming 265


11.1 Key concepts 265
11.2 Pragmatics 266
11.2.1 A simple spellchecker 268
11.3 Case study: C 269
11.3.1 Values and types 269
11.3.2 Variables, storage, and control 272
xii Contents

11.3.3 Bindings and scope 274


11.3.4 Procedural abstraction 274
11.3.5 Independent compilation 275
11.3.6 Preprocessor directives 276
11.3.7 Function library 277
11.3.8 A simple spellchecker 278
11.4 Case study: ADA 281
11.4.1 Values and types 281
11.4.2 Variables, storage, and control 282
11.4.3 Bindings and scope 282
11.4.4 Procedural abstraction 283
11.4.5 Data abstraction 283
11.4.6 Generic abstraction 285
11.4.7 Separate compilation 288
11.4.8 Package library 289
11.4.9 A simple spellchecker 289
Summary 292
Further reading 293
Exercises 293

12 Object-oriented programming 297


12.1 Key concepts 297
12.2 Pragmatics 298
12.3 Case study: C++ 299
12.3.1 Values and types 300
12.3.2 Variables, storage, and control 300
12.3.3 Bindings and scope 300
12.3.4 Procedural abstraction 301
12.3.5 Data abstraction 302
12.3.6 Generic abstraction 306
12.3.7 Independent compilation and preprocessor directives 307
12.3.8 Class and template library 307
12.3.9 A simple spellchecker 308
12.4 Case study: JAVA 311
12.4.1 Values and types 312
12.4.2 Variables, storage, and control 313
12.4.3 Bindings and scope 314
12.4.4 Procedural abstraction 314
12.4.5 Data abstraction 315
12.4.6 Generic abstraction 317
12.4.7 Separate compilation and dynamic linking 318
12.4.8 Class library 319
12.4.9 A simple spellchecker 320
12.5 Case study: ADA95 322
12.5.1 Types 322
12.5.2 Data abstraction 325
Contents xiii

Summary 328
Further reading 328
Exercises 329

13 Concurrent programming 333


13.1 Key concepts 333
13.2 Pragmatics 334
13.3 Case study: ADA95 336
13.3.1 Process creation and termination 336
13.3.2 Mutual exclusion 338
13.3.3 Admission control 339
13.3.4 Scheduling away deadlock 347
13.4 Case study: JAVA 355
13.4.1 Process creation and termination 356
13.4.2 Mutual exclusion 358
13.4.3 Admission control 359
13.5 Implementation notes 361
Summary 363
Further reading 363
Exercises 363

14 Functional programming 367


14.1 Key concepts 367
14.1.1 Eager vs normal-order vs lazy evaluation 368
14.2 Pragmatics 370
14.3 Case study: HASKELL 370
14.3.1 Values and types 370
14.3.2 Bindings and scope 374
14.3.3 Procedural abstraction 376
14.3.4 Lazy evaluation 379
14.3.5 Data abstraction 381
14.3.6 Generic abstraction 382
14.3.7 Modeling state 384
14.3.8 A simple spellchecker 386
Summary 387
Further reading 388
Exercises 389

15 Logic programming 393


15.1 Key concepts 393
15.2 Pragmatics 396
15.3 Case study: PROLOG 396
15.3.1 Values, variables, and terms 396
15.3.2 Assertions and clauses 398
15.3.3 Relations 398
15.3.4 The closed-world assumption 402
15.3.5 Bindings and scope 403
xiv Contents

15.3.6 Control 404


15.3.7 Input/output 406
15.3.8 A simple spellchecker 407
Summary 409
Further reading 410
Exercises 410
16 Scripting 413
16.1 Pragmatics 413
16.2 Key concepts 414
16.2.1 Regular expressions 415
16.3 Case study: PYTHON 417
16.3.1 Values and types 418
16.3.2 Variables, storage, and control 419
16.3.3 Bindings and scope 421
16.3.4 Procedural abstraction 421
16.3.5 Data abstraction 422
16.3.6 Separate compilation 424
16.3.7 Module library 425
Summary 427
Further reading 427
Exercises 427

Part V: Conclusion 429


17 Language selection 431
17.1 Criteria 431
17.2 Evaluation 433
Summary 436
Exercises 436
18 Language design 437
18.1 Selection of concepts 437
18.2 Regularity 438
18.3 Simplicity 438
18.4 Efficiency 441
18.5 Syntax 442
18.6 Language life cycles 444
18.7 The future 445
Summary 446
Further reading 446
Exercises 447
Bibliography 449
Glossary 453
Index 465
Preface

The first programming language I ever learned was ALGOL60. This language was
notable for its elegance and its regularity; for all its imperfections, it stood head and
shoulders above its contemporaries. My interest in languages was awakened, and
I began to perceive the benefits of simplicity and consistency in language design.
Since then I have learned and programmed in about a dozen other languages,
and I have struck a nodding acquaintance with many more. Like many pro-
grammers, I have found that certain languages make programming distasteful, a
drudgery; others make programming enjoyable, even esthetically pleasing. A good
language, like a good mathematical notation, helps us to formulate and communi-
cate ideas clearly. My personal favorites have been PASCAL, ADA, ML, and JAVA.
Each of these languages has sharpened my understanding of what programming
is (or should be) all about. PASCAL taught me structured programming and data
types. ADA taught me data abstraction, exception handling, and large-scale pro-
gramming. ML taught me functional programming and parametric polymorphism.
JAVA taught me object-oriented programming and inclusion polymorphism. I had
previously met all of these concepts, and understood them in principle, but I did
not truly understand them until I had the opportunity to program in languages
that exposed them clearly.

Contents
This book consists of five parts.
Chapter 1 introduces the book with an overview of programming linguistics
(the study of programming languages) and a brief history of programming and
scripting languages.
Chapters 2–5 explain the basic concepts that underlie almost all programming
languages: values and types, variables and storage, bindings and scope, procedures
and parameters. The emphasis in these chapters is on identifying the basic
concepts and studying them individually. These basic concepts are found in almost
all languages.
Chapters 6–10 continue this theme by examining some more advanced con-
cepts: data abstraction (packages, abstract types, and classes), generic abstraction
(or templates), type systems (inclusion polymorphism, parametric polymor-
phism, overloading, and type conversions), sequencers (including exceptions), and
concurrency (primitives, conditional critical regions, monitors, and rendezvous).
These more advanced concepts are found in the more modern languages.
Chapters 11–16 survey the most important programming paradigms, compar-
ing and contrasting the long-established paradigm of imperative programming
with the increasingly important paradigms of object-oriented and concurrent pro-
gramming, the more specialized paradigms of functional and logic programming,
and the paradigm of scripting. These different paradigms are based on different

xv
xvi Preface

selections of key concepts, and give rise to sharply contrasting styles of language
and of programming. Each chapter identifies the key concepts of the subject
paradigm, and presents an overview of one or more major languages, showing
how concepts were selected and combined when the language was designed.
Several designs and implementations of a simple spellchecker are presented to
illustrate the pragmatics of programming in all of the major languages.
Chapters 17 and 18 conclude the book by looking at two issues: how to select
a suitable language for a software development project, and how to design a
new language.
The book need not be read sequentially. Chapters 1–5 should certainly be
read first, but the remaining chapters could be read in many different orders.
Chapters 11–15 are largely self-contained; my recommendation is to read at least
some of them after Chapters 1–5, in order to gain some insight into how major
languages have been designed. Figure P.1 summarizes the dependencies between
the chapters.

Examples and case studies


The concepts studied in Chapters 2–10 are freely illustrated by examples. These
examples are drawn primarily from C, C++, JAVA, and ADA. I have chosen these
languages because they are well known, they contrast well, and even their flaws
are instructive!

1
Introduction

2 3 4 5
Values and Variables and Bindings and Procedural
Types Storage Scope Abstraction

6 7 8 9 10
Data Generic Type Control Concurrency
Abstraction Abstraction Systems Flow

11 12 13 14 15 16
Imperative OO Concurrent Functional Logic Scripting
Programming Programming Programming Programming Programming

17 18
Language Language
Selection Design

Figure P.1 Dependencies between chapters of this book.


Preface xvii

The paradigms studied in Chapters 11–16 are illustrated by case studies of


major languages: ADA, C, C++, HASKELL, JAVA, PROLOG, and PYTHON. These
languages are studied only impressionistically. It would certainly be valuable for
readers to learn to program in all of these languages, in order to gain deeper insight,
but this book makes no attempt to teach programming per se. The bibliography
contains suggested reading on all of these languages.

Exercises
Each chapter is followed by a number of relevant exercises. These vary from
short exercises, through longer ones (marked *), up to truly demanding ones
(marked **) that could be treated as projects.
A typical exercise is to analyze some aspect of a favorite language, in the
same way that various languages are analyzed in the text. Exercises like this are
designed to deepen readers’ understanding of languages that they already know,
and to reinforce understanding of particular concepts by studying how they are
supported by different languages.
A typical project is to design some extension or modification to an existing
language. I should emphasize that language design should not be undertaken
lightly! These projects are aimed particularly at the most ambitious readers, but
all readers would benefit by at least thinking about the issues raised.

Readership
All programmers, not just language specialists, need a thorough understanding
of language concepts. This is because programming languages are our most
fundamental tools. They influence the very way we think about software design
and implementation, about algorithms and data structures.
This book is aimed at junior, senior, and graduate students of computer
science and information technology, all of whom need some understanding of
the fundamentals of programming languages. The book should also be of inter-
est to professional software engineers, especially project leaders responsible
for language evaluation and selection, designers and implementers of language
processors, and designers of new languages and of extensions to existing languages.
To derive maximum benefit from this book, the reader should be able to
program in at least two contrasting high-level languages. Language concepts can
best be understood by comparing how they are supported by different languages. A
reader who knows only a language like C, C++, or JAVA should learn a contrasting
language such as ADA (or vice versa) at the same time as studying this book.
The reader will also need to be comfortable with some elementary concepts
from discrete mathematics – sets, functions, relations, and predicate logic – as
these are used to explain a variety of language concepts. The relevant mathematical
concepts are briefly reviewed in Chapters 2 and 15, in order to keep this book
reasonably self-contained.
This book attempts to cover all the most important aspects of a large subject.
Where necessary, depth has been sacrificed for breadth. Thus the really serious
xviii Preface

student will need to follow up with more advanced studies. The book has an
extensive bibliography, and each chapter closes with suggestions for further
reading on the topics covered by the chapter.

Acknowledgments
Bob Tennent’s classic book Programming Language Principles has profoundly
influenced the way I have organized this book. Many books on programming
languages have tended to be syntax-oriented, examining several popular languages
feature by feature, without offering much insight into the underlying concepts
or how future languages might be designed. Some books are implementation-
oriented, attempting to explain concepts by showing how they are implemented
on computers. By contrast, Tennent’s book is semantics-oriented, first identifying
and explaining powerful and general semantic concepts, and only then analyzing
particular languages in terms of these concepts. In this book I have adopted Ten-
nent’s semantics-oriented approach, but placing far more emphasis on concepts
that have become more prominent in the intervening two decades.
I have also been strongly influenced, in many different ways, by the work
of Malcolm Atkinson, Peter Buneman, Luca Cardelli, Frank DeRemer, Edsger
Dijkstra, Tony Hoare, Jean Ichbiah, John Hughes, Mehdi Jazayeri, Bill Joy, Robin
Milner, Peter Mosses, Simon Peyton Jones, Phil Wadler, and Niklaus Wirth.
I wish to thank Bill Findlay for the two chapters (Chapters 10 and 13) he has
contributed to this book. His expertise on concurrent programming has made this
book broader in scope than I could have made it myself. His numerous suggestions
for my own chapters have been challenging and insightful.
Last but not least, I would like to thank the Wiley reviewers for their
constructive criticisms, and to acknowledge the assistance of the Wiley editorial
staff led by Gaynor Redvers-Mutton.

David A. Watt
Brisbane
March 2004
PART I

INTRODUCTION

Part I introduces the book with an overview of programming linguistics and a


brief history of programming and scripting languages.

1
Chapter 1

Programming languages

In this chapter we shall:


• outline the discipline of programming linguistics, which is the study of program-
ming languages, encompassing concepts and paradigms, syntax, semantics, and
pragmatics, and language processors such as compilers and interpreters;
• briefly survey the historical development of programming languages, covering the
major programming languages and paradigms.

1.1 Programming linguistics


The first high-level programming languages were designed during the 1950s. Ever
since then, programming languages have been a fascinating and productive area
of study. Programmers endlessly debate the relative merits of their favorite pro-
gramming languages, sometimes with almost religious zeal. On a more academic
level, computer scientists search for ways to design programming languages that
combine expressive power with simplicity and efficiency.
We sometimes use the term programming linguistics to mean the study of
programming languages. This is by analogy with the older discipline of linguistics,
which is the study of natural languages. Both programming languages and natural
languages have syntax (form) and semantics (meaning). However, we cannot take
the analogy too far. Natural languages are far broader, more expressive, and
subtler than programming languages. A natural language is just what a human
population speaks and writes, so linguists are restricted to analyzing existing (and
dead) natural languages. On the other hand, programming linguists can not only
analyze existing programming languages; they can also design and specify new
programming languages, and they can implement these languages on computers.
Programming linguistics therefore has several aspects, which we discuss briefly
in the following subsections.

1.1.1 Concepts and paradigms


Every programming language is an artifact, and as such has been consciously
designed. Some programming languages have been designed by a single person
(such as C++), others by small groups (such as C and JAVA), and still others by
large groups (such as ADA).
A programming language, to be worthy of the name, must satisfy certain
fundamental requirements.

3
4 Chapter 1 Programming languages

A programming language must be universal. That is to say, every problem


must have a solution that can be programmed in the language, if that problem can
be solved at all by a computer. This might seem to be a very strong requirement,
but even a very small programming language can meet it. Any language in which
we can define recursive functions is universal. On the other hand, a language with
neither recursion nor iteration cannot be universal. Certain application languages
are not universal, but we do not generally classify them as programming languages.
A programming language should also be reasonably natural for solving prob-
lems, at least problems within its intended application area. For example, a
programming language whose only data types are numbers and arrays might be
natural for solving numerical problems, but would be less natural for solving prob-
lems in commerce or artificial intelligence. Conversely, a programming language
whose only data types are strings and lists would be an unnatural choice for solving
numerical problems.
A programming language must also be implementable on a computer. That is
to say, it must be possible to execute every well-formed program in the language.
Mathematical notation (in its full generality) is not implementable, because in
this notation it is possible to formulate problems that cannot be solved by any
computer. Natural languages also are not implementable, because they are impre-
cise and ambiguous. Therefore, mathematical notation and natural languages, for
entirely different reasons, cannot be classified as programming languages.
In practice, a programming language should be capable of an acceptably
efficient implementation. There is plenty of room for debate over what is acceptably
efficient, especially as the efficiency of a programming language implementation
is strongly influenced by the computer architecture. FORTRAN, C, and PASCAL
programmers might expect their programs to be almost as efficient (within a factor
of 2–4) as the corresponding assembly-language programs. PROLOG programmers
have to accept an order of magnitude lower efficiency, but would justify this on
the grounds that the language is far more natural within its own application area;
besides, they hope that new computer architectures will eventually appear that
are more suited for executing PROLOG programs than conventional architectures.
In Parts II and III of this book we shall study the concepts that underlie
the design of programming languages: data and types, variables and storage,
bindings and scope, procedural abstraction, data abstraction, generic abstraction,
type systems, control, and concurrency. Although few of us will ever design a
programming language (which is extremely difficult to do well), as programmers
we can all benefit by studying these concepts. Programming languages are our
most basic tools, and we must thoroughly master them to use them effectively.
Whenever we have to learn a new programming language and discover how it
can be effectively exploited to construct reliable and maintainable programs, and
whenever we have to decide which programming language is most suitable for
solving a given problem, we find that a good understanding of programming
language concepts is indispensable. We can master a new programming language
most effectively if we understand the underlying concepts that it shares with other
programming languages.
1.1 Programming linguistics 5

Just as important as the individual concepts are the ways in which they may
be put together to design complete programming languages. Different selections
of key concepts support radically different styles of programming, which are
called paradigms. There are six major paradigms. Imperative programming is
characterized by the use of variables, commands, and procedures; object-oriented
programming by the use of objects, classes, and inheritance; concurrent pro-
gramming by the use of concurrent processes, and various control abstractions;
functional programming by the use of functions; logic programming by the use of
relations; and scripting languages by the presence of very high-level features. We
shall study all of these paradigms in Part IV of this book.

1.1.2 Syntax, semantics, and pragmatics


Every programming language has syntax, semantics, and pragmatics. We have
seen that natural languages also have syntax and semantics, but pragmatics is
unique to programming languages.
• A programming language’s syntax is concerned with the form of programs:
how expressions, commands, declarations, and other constructs must be
arranged to make a well-formed program.
• A programming language’s semantics is concerned with the meaning of
programs: how a well-formed program may be expected to behave when
executed on a computer.
• A programming language’s pragmatics is concerned with the way in which
the language is intended to be used in practice.
Syntax influences how programs are written by the programmer, read by
other programmers, and parsed by the computer. Semantics determines how
programs are composed by the programmer, understood by other programmers,
and interpreted by the computer. Pragmatics influences how programmers are
expected to design and implement programs in practice. Syntax is important, but
semantics and pragmatics are more important still.
To underline this point, consider how an expert programmer thinks, given a
programming problem to solve. Firstly, the programmer decomposes the prob-
lem, identifying suitable program units (procedures, packages, abstract types,
or classes). Secondly, the programmer conceives a suitable implementation of
each program unit, deploying language concepts such as types, control structures,
exceptions, and so on. Lastly, the programmer codes each program unit. Only at
this last stage does the programming language’s syntax become relevant.
In this book we shall pay most attention to semantic and pragmatic issues. A
given construct might be provided in several programming languages, with varia-
tions in syntax that are essentially superficial. Semantic issues are more important.
We need to appreciate subtle differences in meaning between apparently similar
constructs. We need to see whether a given programming language confuses dis-
tinct concepts, or supports an important concept inadequately, or fails to support
it at all. In this book we study those concepts that are so important that they are
supported by a variety of programming languages.
6 Chapter 1 Programming languages

In order to avoid distracting syntactic variations, wherever possible we shall


illustrate each concept using the following programming languages: C, C++, JAVA,
and ADA. C is now middle-aged, and its design defects are numerous; however, it is
very widely known and used, and even its defects are instructive. C++ and JAVA are
modern and popular object-oriented languages. ADA is a programming language
that supports imperative, object-oriented, and concurrent programming. None of
these programming languages is by any means perfect. The ideal programming
language has not yet been designed, and is never likely to be!

1.1.3 Language processors


This book is concerned only with high-level languages, i.e., programming languages
that are (more or less) independent of the machines on which programs are
executed. High-level languages are implemented by compiling programs into
machine language, by interpreting them directly, or by some combination of
compilation and interpretation.
Any system for processing programs – executing programs, or preparing them
for execution – is called a language processor. Language processors include com-
pilers, interpreters, and auxiliary tools like source-code editors and debuggers.
We have seen that a programming language must be implementable. However,
this does not mean that programmers need to know in detail how a programming
language is implemented in order to understand it thoroughly. Accordingly,
implementation issues will receive limited attention in this book, except for a
short section (‘‘Implementation notes’’) at the end of each chapter.

1.2 Historical development


Today’s programming languages are the product of developments that started in
the 1950s. Numerous concepts have been invented, tested, and improved by being
incorporated in successive programming languages. With very few exceptions, the
design of each programming language has been strongly influenced by experience
with earlier languages. The following brief historical survey summarizes the
ancestry of the major programming languages and sketches the development of
the concepts introduced in this book. It also reminds us that today’s programming
languages are not the end product of developments in programming language
design; exciting new concepts, languages, and paradigms are still being developed,
and the programming language scene ten years from now will probably be rather
different from today’s.
Figure 1.1 summarizes the dates and ancestry of several important program-
ming languages. This is not the place for a comprehensive survey, so only the
major programming languages are mentioned.
FORTRAN was the earliest major high-level language. It introduced symbolic
expressions and arrays, and also procedures (‘‘subroutines’’) with parameters. In
other respects FORTRAN (in its original form) was fairly low-level; for example, con-
trol flow was largely effected by conditional and unconditional jumps. FORTRAN has
developed a long way from its original design; the latest version was standardized
as recently as 1997.
Discovering Diverse Content Through
Random Scribd Documents
from the garden became the waste, just as the growth and renewal
of life had stopped for the old pair, leaving nothing but desolation
before their feet.
Yet still the earth was with them, and Simon turned his eyes
again and again to its vague outlines with relief. Across the bay the
cone of the Knott still held to its tangibility and form, protesting
against the swamping hand of night. The crown of it, fitted with
wood as closely as with a cap, was darker against the sky than the
shadowy slopes on which the houses climbed. And, nearer inland
still, on the low edge of shore that was like a trail of smoke on the
farther side of the sands, a blur of formless yet purposeful grey
showed where the tiny hamlet of Sandyeat clustered about the
'Ship.'
Sandholes was in sight now, and the horse quickened its pace,
triumphing over the last few wearisome yards. As they approached
the house, with its white face set on a body of looming buildings
behind, they had as always a mingled sensation of sadness and
relief. Not that the place was sad to them because of its dreary
emptiness set amongst formless fields. In the course of years it had
become for them merely an atmosphere, not a thing of sight. They
were only depressed by it because for them it was the heart of
failure and loss. And in the same way they were relieved by it,
dignified, sanctuaried and consoled, because this was their hiding-
place against the world, and here the heart of their few memories of
joy.
The house was dark, but they were accustomed to that, used to
the door that would not open, however they knocked, and the
windows that for ever would never frame a face, however they
hailed. They were used to that stumbling into the place in the
folding dark, to the striking of a match that brought them nothing
but the dreary waiting rigidity of the things they had left behind.
They were used, too, to an uprising fear on the struck light that
some terrible change might have taken place in the empty house;
that even the waiting things might have played them false while they
were gone....
So lonely looked the place, that it seemed as if it might even
revenge itself upon those who had the temerity to awaken it during
that sinking hour, but, as they reached the gate, the old dog asleep
in a loose box aroused himself to a hoarse, recognising bark. The
few cows, also, waiting to be fed, sent out deep complaints at the
sound of the coming wheels. And as they finally rattled into the
uneven yard, a woman's figure stood up and waved to them from
the sea-wall.

PART III

MAY

The afternoon which had seen Sarah's short-lived splendour had


been sweet also for May. Sweeter, indeed, since for her there was no
clashing of fierce passions to jar the tender witchery of her mood.
And though the glamour was of the past,--a sheet of gold as of
sunlight far at the back of her mind; a sea of gold from which she
moved ever inward towards the darkness of the hills,--a tongue of
light had suddenly darted from it to stream like a golden wind-blown
ribbon over her path. That light was the knowledge that in her own
hands lay the possibility of Geordie's return.
Youth came back to her with the thought, and she sat straighter
still in the trap, holding her unused whip at a jaunty angle across the
elastic bar of the reins. The good horse swung homewards in a
generous stride; the bright wheels of the dog-cart flashed through
the dull country like a whirled autumn leaf. The passers-by found a
special sweetness in her ready smile, because it reflected the secret
in her heart. As they went on their way they said what they always
said,--that it was a marvel she had not married long ago.
Yet the secret, fair as it was, had also the folly of all great
ventures, since, in laying her hands upon the future, she risked the
memory that had coloured her whole life. To bring Geordie home
might mean nothing but disappointment for herself, sordid
disappointment and shame for a mis-spent girlish dream. Things
would be different, at the very best; part of the memory would have
to go. But the chief people to be considered were the old folks who
had so often been the footballs of fate. Nothing that she might fear
on her own account should stand in the way of this sudden
fulfilment for a frustrated old man, this light to the eyes for an old
woman going blind. In any case May was the sort that would
tenderly handle the cracked and mended pot right up to the moment
of dissolution at the well. No disappointment that Geordie could
bring her would remain sordid for very long. Out of her shattered
idols her wisdom and humour would gather her fresh beauty; clear-
eyed, uplifting affection for youthful worship, and pity and
tenderness for passion.
It was true that Sarah had already rejected her offer,--brutally,
almost, in her determination that May should suffer no further for
her son. But May had already almost forgotten the rough sentences
which for the time being had slammed the opening door in her eager
face. Sarah was strong, she knew, but she herself, because of love in
the past and pity in the present, felt stronger still. She said to
herself, smiling, that sooner or later she would find an argument that
would serve. Sooner or later Sarah would yield, and share with
secret delight in the surprise that they would so gaily prepare for the
old man. Sooner or later the boat would put out from port that
carried the lost lad,--Geordie, with his pockets empty but his heart
full, and every nerve of him reaching towards his home.
Now she had turned the end of the bay, and was running along
the flat road that hugged the curve of the shore. Below on her right
were the sands, almost within flick of her whip, with the river-
channel winding its dull length a hundred yards away. Beyond it, the
sand narrowed into the arm of the marsh, until the eye caught the
soft etching of the Thornthwaite farm, set on the faint gold and
green of the jutting land.
The inn, low, white-faced, dark, with all the light of it in the
eyes that looked so far abroad, was very quiet when she came to it
about three o'clock. The odd-job man was waiting about to take her
horse, and she paused to have a word or two with him in the yard.
Then she went briskly into the silent place, and at once the whole
drowsy air of it stirred and became alive. The spotlessness of the
house seemed to take on a sparkling quality from the swift vitality of
her presence. The very fire seemed to burn brighter when she
entered, and the high lights on the steels and brasses to take a finer
gleam. Her father called to her from the room where he lay upstairs,
and her buoyant tread, as she went up, seemed to strengthen even
his numb limbs and useless feet.
She sat by his bed for some time, telling him all the news, and
conveying as much as she could of the hiring and marketing stir
combined. This particular person had wished to know how he was;
the other had sent him a message to be delivered word for word.
One had a grandmother who had died in similar case; another a
remedy that would recover him in a week. Bits of gossip she had for
him, sketches of old friends; stories of old traits cropping up again
which made him chuckle and cap them from the past. By the time
she had finished he was firmly linked again to life, and had forgotten
that deadly detachment which oppresses the long-sick. Indeed, he
almost forgot, as he listened, that he had not been in Witham
himself, hearing the gossip with his own ears and seeing the familiar
faces with his own eyes. For the time being he was again part of
that central country life, the touchstone by which country-folk test
reality and the truth of things, and by contact with which their own
identity is intensified and preserved.
But her eyes were turned continually to the window as she
chatted and laughed, dwelling upon the misty picture even when
they were not followed by her mind. Only her brain answered
without fail when her gaze travelled to the farm on the farther shore.
Gradually the picture shadowed and dimmed in line, but still she sat
by the bed and laughed with her lips while her heart looked always
abroad. Neither she nor her father ever drew a blind in the little inn.
They had lived so long with that wide prospect stretching into the
house that they would have stifled mentally between eyeless walls.
She talked until he was tired, and then she made his tea, and
left him happy with the papers which she had brought from Witham.
Her own tea she ate mechanically, with the whole of her mind still
fixed on the promise of the day, and when she had finished she was
drawn to the window again before she knew. The Thornthwaites
would be home by now, she concluded, looking out. Tired and
discouraged, they would be back again at the farm, feeling none of
the quivering hope which lifted and thrilled her heart. Sarah would
not even dwell on the offer, having put it by for good, and Simon did
not as much as know that there had been an offer at all. They would
creep to bed and sleep drearily, or wake drearily against their will,
while she would wake of her own accord in order to clasp her
purpose and find it still alive. She could not bear the thought of the
long, blank night which would so soon be wrapping them round;
even a stubborn refusal of her hope would be a better friend to
them than that. Stronger and stronger grew the knowledge within
her that she must see them before they slept. It was for their sake,
she told herself, at first, thirsting to be across, and then, as she
clinched her decision, knew it was also for her own.
She went upstairs again to put on her coat and hat, wondering
as she did so what her father would have to say. He would be sure
to enquire what took her across the sands so late, yet he would
wonder and fret if she left him without a word. Geordie's name had
dropped into silence between them for many a year, and, lately as
she had spoken it to Sarah, it would be hard to speak it now. She
knew only too well what her father would think of her offer of hard-
saved gold. He had always been bitter against Geordie for her sake,
and would want no wastrel fetched overseas to play on her pity
again. She stole half-way down the stairs, and then was vexed with
herself and went up again with a resolute tread. Once more she
hesitated, with her hand on the door-latch, and then it slipped from
her finger and she found herself in the room.
Fleming looked up from his paper with his faded eyes. "Off
again, lass?" he enquired, noticing how she was dressed. "Is there a
pill-gill Milthrop way to-night?"
She shook her head.
"Not as I know of.... Nay, I'm sure there's not." She stood
staring at him, uncertain what to say, and then her eyes, as if of
their own accord, turned back towards the sands. "I just felt like
going out a bit again, that's all."
"Likely you're going up road for a crack wi' Mrs. Bridge?"
"Nay ... I didn't think o' going there."
"To t'station, happen?"
"Nor that, neither...." There was a little pause. "Just--out," she
added, and the note in her voice seemed to reach before her over
the sandy waste. Fleming heard it, and saw the track of her gaze as
well.
"What's up, lass?" he asked quietly, letting his paper drop.
"What d'you want to do?"
She braced herself then, swinging round to him with one of her
cheerful laughs. "You'll think I'm daft, I know," she said, looking
down at him with dancing eyes, "but I'm right set on seeing Mrs.
Thornthet again to-night. We'd a deal to say to each other this
morning, but we didn't finish our talk. I thought I could slip over
sand and back before it was dark."
Fleming looked perturbed.
"It's over late for that, isn't it?" he asked. "Light's going pretty
fast an' all. Hadn't you best bide till morning, and gang then?"
"I don't feel as I can. I'm set on going to-night. I've often been
across as late, you'll think on. I'll take right good care."
"What about tide?"
"Not for a couple of hours yet, and I've not that much to say.
Boat's ready alongside channel; it nobbut wants shoving off. I'll be
there and back before you can say knife."
"Ay, well, then, you'd best be off, and look sharp about it!"
Fleming conceded in a reluctant tone. "I'll have t'lamp put in winder
as usual to set you back. Don't you get clattin' now and forget to see
if it's there."
"I'll look out for it, don't you fret. Like as not I'll never go inside
the house. There's just something I want to make sure of before I
sleep."
She nodded brightly and began to move away, but he called her
back before she reached the door. With the quickness of those who
lie long in a sick room, he had noticed the change in her atmosphere
at once. Restlessness and impatience were strange things to find in
May, and there was a touch of excitement in her manner as well. He
looked at her thoughtfully as she retraced her steps.
"Is there any news o' that wastrel lad o' theirs? Happen he's
thinking o' coming back?"
The words spoken from another's mouth brought a rush of
certainty to her longing mind. She answered him confidently, as if
she held the actual proof.
"That's it, father! That's right." She laughed on a buoyant,
happy note. "Our Geordie's coming home!"
"To-night?" Fleming's mouth opened. "D'ye mean he's coming
to-night?"
"Nay, I don't know about that!" She laughed again. "But it'll be
before so long. I feel as sure about it as if he was knocking at
Sandholes door!"
"You've no call to be glad of it, as I can see," Fleming said, with
a touch of fretfulness in his tone. "Are you thinking o' wedding him
after all this time?"
Her head drooped a little.
"I'm past thinking o' that, and he'll have been past it long ago.
I'm just glad for the old folks' sake, that's all. It's like as if it was
somebody dead that was coming back, so that I needn't believe in
death and suchlike any more. It's like as if it's myself as is coming
back,--as if I should open door and see the lass I used to be
outside."
"I'd be glad to see you settled afore I went, but not wi' an idle
do-nowt as'd spoil your life. It'll be queer to me if Geordie
Thornthet's made much out. He was a wastrel, right enough, for all
his wheedlin' ways."
"I'm past thinking o' marriage," she said again. "It's just what it
means to the old folks, poor old souls!"
"Ay. They've had a mighty poor time, they have that." He
sighed, thinking of many a tale of woe unfolded by Simon beside his
bed. Then he looked up at her with a whimsical smile. "They'd
nobbut the one bairn, same as your mother and me, and there's
been whiles I've been real mad because you weren't a lad. Ay, well,
I've lived to see the folly o' my ways, and to thank God I'd nobbut a
lass! You're worth a dozen Geordie Thornthets any day o' the
week...."
She was gone with an answering smile directly he finished his
speech, and the sound of her feet was light and swift on the stair.
Hearing her, he, too, seemed to see her a girl again, gone to meet
Geordie Thornthwaite along the shore. But instead of reviving and
cheering him, it made him sad. He was too near the end to wish
himself back at the start. He glanced at the lamp on the table to
make sure that it was filled, and settled himself back to his papers
with a sigh.

II

May stopped to speak to the hired girl as she went out, and was
alarmed by the creeping dusk already in the inn. She breathed again
when she was in the road, and saw the dull light holding yet on
either hand. The soft closing of the door behind her back gave her a
long-forgotten thrill, bringing back similar autumn evening hours,
when she had gone to meet a lover from over the sands.
She got down to the shore about the time that the scene at
Blindbeck was drawing to an end. She hurried, not only because she
had little or no time to waste, but because she could not have gone
slowly if she had tried. The young May had never gone slowly, who
was all kindness and knew nothing of pride. She ran down the
shingle and across the sand, only pausing to draw breath and to
reprove herself at the channel's edge. Passers-by on the flat road
stopped to stare at her as she sped across, wondering what she
could be doing at that hour. Pausing, she looked across at the farm
before she bent to the boat, chiding herself for her almost childish
haste. But her tongue ached to let loose the words of persuasion
that she carried with her, and her heart ached for the word of
permission that she was sure she would carry back. She did not
doubt for a moment that Sarah would give way, so strong was her
inward belief that Geordie was coming home.
At last she pushed off, stepped in and punted herself across,
and once out again on dry ground tried to hold herself to a walk.
The sand, ribbed and hard beneath her feet, spoke to the fact that
the tide had been gone for hours. It was extraordinary how
forgotten the sands always seemed as soon as the tide had gone
away. Only those who had proved it by daily experience could
believe that the water would ever return. Even to them it remained
something of the miracle that it was in truth, arousing continually a
thrill of awed surprise. Yet, side by side with that impression of final
retreat, of waste that had always been waste and would never be
reclaimed, was one of a brooding terror that was only waiting its
hour. The sea and the sands were like cat and mouse, May thought,-
-the one, aloof, indifferent, yet always poised to leap; the other,
inert, paralysed though apparently free, and always the certain
victim in the end.
She looked behind and before from the quiet home which she
had left to the still more lonely and quiet house which was her goal.
There was a point about half-way across at which it seemed as if she
would never reach the one, never get back to the other in all time.
Both seemed to recede from her equally as she moved, vague
shapes formed only of imagination and the mist. Just for a moment
that vagueness of things which she knew to be concrete caught her
by the throat. The little that she could see of the earth was so
cloudlike, so lacking in sturdy strength. The very shore of the marsh
looked as though a breath might dissolve it in thin air. Though the
distance across was little more than a mile, the feeling of space
around her was infinite as the sky. The sands seemed suddenly to
become a treadmill under her feet, turning and turning, but never
bringing her to the horizon which she sought. The whole doorway of
the bay was blocked by the great wall of mist, and over the Lake
mountains there was a smother of mist, and mist over all the land
that went east to the Pennine range. She began to fear even the
crinkled sand which felt so firm, as if it might suddenly sway and
shift like one of the many traps with which the bay was sown.
Behind her, the grey, faint-gleaming strip of the channel seemed to
cut her off from her safe home. A slice of the bank broke suddenly
with an echoing spash, chilling her with the lonely terror of water
that has a victim in its hold. The boat, helpless-looking, inert, a mere
black speck on the channel edge, seemed the only insoluble thing
beside herself. She longed for the comfort of her feet on the tarred
boards, for the reassurance of her hands against the sculls. It was a
moment or two before she had the courage to let it go, and face a
world that was full of bodiless shapes and evanescent shores.
But almost before she knew it she was on the opposite side,
scrambling up the stones to the grassy slope beyond, and so,
panting and hurrying, to the top of the sea-wall. She saw at once
that there was nobody in the house, that it was still with the growing
stillness of augmented hours, and a further chill fell on her happy
mood. Yet she was glad at least to be there to welcome the old folks
when they came, and in any case they could not be very far. Every
jolt of the trap must be bringing them nearer to the net which she
was spreading so lovingly for their feet. They would be tired, of
course, and probably very cross, but May was used to market-day
moods and would not care. With affectionate ruthlessness she told
herself that would yield to her all the sooner for being tired.
Presently they would agree unwillingly that she might have her way,
and then she would hurry home again as if on wings. They would be
crosser than ever after she had gone, vexed both with her and
themselves and terribly touched in their pride. And then, slowly but
surely, the hope that she had forced upon them would begin to race
its stimulant through their veins. They would lie down to sleep with
a secret gladness that they had not the courage to confess, and
would wake in the morning and know that the world had been made
for them anew.
She kept stopping the rush of her thoughts to send her senses
over the marsh, but no sign of life came back to her, or sound of
wheel or hoof. The wide stretches of grass and plough and the long
length of road seemed almost as unsuggestive of human influence
as the sands themselves. Swifter and swifter faded the passionate
confidence which had sent her out, leaving the risks of the matter
uppermost in her mind. She remembered that it was possible to be
patient all one's life, and yet to wreck the fruits of it in an unguarded
hour. This sudden mental and physical rashness might be symbolical
of a greater rashness of the soul. Perhaps after to-night all her
footholds and anchorages might go, leaving the world that she had
managed so bravely only a nightmare blurred by tears.
The dusk thickened about her as the night tried to impress itself
on the earth as a separate entity from the mist. The most that it
could do, however, was to produce the effect of a hovering shadow
from some huge arrested wing. The real warning of night was in the
deepened sense of loneliness and dread of personal diminution in a
growing space, in the further recession of things unseen as well as
seen. It lay, too, in the stirring consciousness of the impending
advent of the tide. She began to look anxiously towards her father's
window for the lamp, and though she was comforted when she saw
no sign, it stamped the illusion of desolation on her mind. Then she
heard the cattle stir in the shippon as she walked along the wall, and
was cheered and companioned by them for a little while. She would
have gone down to them, or to the dog, who was always a firm
friend, but she was afraid of losing her consciousness of time. She
could not tear herself, either, from her breathless waiting for the
silence to fill with life. She was cold whether she stood or walked,
and more and more oppressed by a sense of folly and grave doubt.
She even laughed at the middle-aged woman who had thrilled like a
girl, but she laughed between her tears. Once or twice she ran down
the bank and on to the sand, but always something drew her back,
and at last, when she had listened so long that she had ceased to
hear, there came the crunching sound of the Thornthwaite wheels. It
was there suddenly where there had been no sign, as if it had only
begun at the moment it reached her ear. At once her courage sprang
up again, and her spirits rose. The whole affair was sweet and brave
once more. It was as if she had heard her lover himself coming
surely towards her over the lonely marsh....

III

Simon uttered an exclamation when he saw the figure on the wall.


His heart leaped first with a supernatural fear, and then with a
sudden foreboding of some normal ill. His nerves were still unstrung
from his experience with the car, and ready enough to shape familiar
objects into ghosts. Even when he had recognised May and spoken
her name, he could not rid himself of his feeling of alarm.
So he was not pleased to see her when she came running
down, and Sarah, who had spent so kindly a morning with her, was
not pleased either. In the last few miles she had seemed to travel
out of human touch, and there was a jar in the sudden intrusion of
even this one thing left to her to love. Her brow contracted both with
the effort of thought and the effort of sight, but indeed she knew
well enough why May was there. Her intuition had worked
uncertainly all the day, but it warned her now. She knew what
impulse had brought May out to await their coming home.
Simon, however, had no clue to this sudden appearance at his
journey's end. He sat still in the trap as she came swiftly through the
yard, and then leaned out to address her with an anxious frown.
"Nay, now whatever's brought you trapesin' here so late? Nowt
wrong, is there? Father badly again? Is he axin' for me, by any
chance?"
She reassured him with a shake of the head and a smile, and,
as in the case of Mr. Dent, he felt a sudden resentment towards
smiles. In all his life Simon had never encountered so many smiling
faces as had looked at him that day.
"All's right, thank you.... Father's much about the same. I
wanted a word with Mrs. Thornthet, that was all.
"You've been a terble while on the road, though!" she added
gaily, before he could speak. "I'd about made up my mind as I'd
have to be getting back."
"We were kept at Blindbeck, that's how it was," Simon said,
remembering suddenly and with gloom the precise circumstances
under which they had been kept. "But if you nobbut wanted a word
wi' the missis, you could surely ha' waited while morn. It's a daft-like
trick to be lakin' on t'sands when it's getting dark."
His words made her turn again to throw a glance at the inn, but
still there was no summoning gleam from the room upstairs. "Ay, but
tide isn't till six," she answered him coaxingly, turning back, "and I
shan't be long. Father'll show a light for me when it's time I was
setting off."
Sarah, ignoring the pair of them, had already clambered out,
and Simon remembered that he had the horse to stable and the
cows to milk and feed. "Danged foolishness, that's what it is!" he
growled, as he scrambled down, giving May a very unaccustomed
scowl. "If I did as I ought, I'd be skifting you pretty sharp. Say what
you've gitten to say, and then clear out!"
Sarah had been moving away from them towards the house,
but, as May followed her, she swung about. There was no invitation,
however, in her rigid face.
"You've nowt to say as I know on," she said in a curt tone, "and
I'm rarely tired. Anyway, there's no sense in lossing yourself for a bit
of a chat."
"I'll not lose myself, not I!" May laughed, advancing towards her,
full of kindly warmth. She had been prepared for some such
reception as this, and was not depressed. "What, I've been across
that often, it's the same to me as the road! I've been over when it
was snowing,--ay, and by moonlight, too. As for Geordie," she
added, with a tender laugh, "he's crossed in the pitch dark, with only
his nose to tell him where he was at!
"I was bound to ask you again before I slept," she urged,
casting a glance at Simon, busy with the horse. "Can't I come in a
minute?--I won't be long. It's late to be telling my business in the
yard."
"You've no business wi' me," Sarah said stolidly, "so you can
stop off yon weam voice. You're not coming into Sandholes to-night,
May Fleming, so that's flat!"
May laughed again, but there was less confidence in the laugh.
She waited to speak again until Simon had moved away, the dog
leaping and barking under the horse's nose.
"It's a shame," she said cheerfully, "to bother you so late, but I
just couldn't bring myself to wait. It was you as brought it all back,
Mrs. Thornthet, come to that, with yon talk at the doctor's of
Geordie coming home!"
"There's no talk of him coming," Sarah said coldly, "and never
was." With one magnificent sweep she disposed of the fallacy of the
afternoon. "You ought to ha' more sense than to go fancying things
like that!"
"But you'd a letter, you said, begging his fare?" May was slightly
bewildered, but went pressing on. "You said he was keen to come, if
he had the brass."
"Ay, and there wasn't no brass; so yon's finished and by wi',"
Sarah said.
"Ay, but there is," May pleaded. "Plenty o' brass!" She faltered a
little before the other's lack of response. "Nay, Mrs. Thornthet, don't
you look like that! What does it matter where it comes from if it
makes folks glad?"
"I'll buy no gladness o' mine from you, my lass, as I said
before."
"I can spare the brass right enough,--if it's only that."
"Ay, but I can't spare the pride to take it," Sarah said.
"Ay, well, then, think as you're buying my happiness!" May
begged. "I'd be real proud to think as I'd brought him back, even if
he never looked aside at me again."
"You'd have lile or nowt to be proud on, I'll be bound!" There
was a touch of weary impatience in Sarah's voice. "And what-like
happiness would it be for you in the end? Nay, May, my girl, we've
thrashed the matter out, and I'm over-tired to be fret wi' it to-night."
May sighed, and stood looking at her with troubled eyes, but
she was unable to let the whole of her hope go.
"I'm right sorry to have put you about," she said sadly. "It's a
real shame! Can't you promise to think it over a bit? I'll come over
to-morrow for another talk."
"I want neither talking nor thinking, so that's flat!" Sarah
snapped. "I'll promise to turn key in the door when I see you
coming, and that's all!"
The tears came into May's eyes.
"You've no call to go telling me off like that," she said, with a
little break in her voice. "I haven't done anything that's wrong, I'm
sure."
"You've shoved your nose into other folks' business," Sarah said
roughly,--"that's what you've done! I'll thank you to leave us to do
for our lad as'll suit us best!"
"He was mine, too!" May flung at her suddenly, roused at last.
"Long ago, maybe,--years on years,--but he was mine as well!"
Sarah gave a sneering laugh.
"There'll be more than one lass, I reckon, setting up to think
that!"
May uttered a little cry, wounded to the heart.
"Eh, but you're a cruel woman, Mrs. Thornthet!" she exclaimed,
in a voice quivering with pain. "It's true I'd be glad to see Geordie
again, but it don't make that much difference now. It's for your sake
and poor Mr. Thornthet's that I want to see him back....
"You're fond o' me, nowadays," she went on bravely, controlling
herself again. "You like me well enough now, whatever you felt once.
Can't you take the money for the sake of bygone times?"
But already Sarah had turned away from her and was moving
towards the door. She fitted the key in the lock with the ease of use,
and gave the rickety door an opening push. And again May followed
and stood, strong in the courage of those who plead for the thing
that they have at heart.
"Don't go away feeling mad with me, Mrs. Thornthet!" she
begged. "I'm sorry I spoke as I did. Think on how happy we were
together, this morning, you and me. Think how it would be if he was
to come marching into the yard...."
Sarah was now over the threshold, with her hand against the
door, but May's hand was also against it, refusing to let it close. Her
face was white as a flower upon the dusky air, pleading and sweet
with frank lips and tearful eyes. Sarah herself was engulfed by the
dark house, a shadow that was yet more surely a block than the
actual door. It seemed to May that she had all the passionless
resistance of some ancient, immovable stone. A lantern across
showed the black squares of the shippon stalls, the white coats of
the beasts and Simon moving from dark to light. May did not know
that the old woman's purpose was giving in the pause, that that last
sentence of hers had broken the stubborn will. She waited
despairingly, seeking for more to say, and finding nothing, since the
right word had been said. And because she despaired she broke the
pause too soon, in an access of hopelessness flinging away her
chance. Taking her hand from the door, she pointed to Simon at his
job.
"I'll ask Mr. Thornthet, then!" she cried sharply, beginning to
move away. "Happen he'll see to it for me instead of you. Happen
he'll see the offer's kindly meant, and not let pride and suchlike
stand between!"
But Sarah, too, cried out before she had gone a yard, her voice
harsh with wrath and a sort of fear.
"You leave Simon be," she cried fiercely,--"let him be! I've had
enough o' your worry, without plaguin' him an' all. You get back to
your dad, and don't come interfering again. You came between me
and my lad, but you shan't meddle wi' my man! You mean well
enough, I don't doubt, but you're nobbut a meddler, all the same. It
never does to go shoving kindnesses at folk who keep on saying nay.
If you force 'em, you do 'em more harm than good in the long run,
by a deal. D'you think I want Geordie coming back in rags, as like a
tramp on t'roads as a couple o' peas? D'you think I want a drunken
do-nowt loafing about t'spot,--a thief, maybe, or happen summat
worse? What sort o' food and drink would yon be to Blindbeck, d'you
think? Eliza's gitten enough on her tongue, without the likes o' that!
Nay, the lad as went was a limb, but he was bonny and smart, and
Eliza'll always think of him like yon. She'll always think in her heart
as he was the better o' Jim, for all she talks so loud. But if he come
back to shame us, it'd rob me even o' that. I couldn't abide it!" she
finished vehemently. "It'd be worse than death. I'd rather the sea
took him afore ever he reached home!"
She stopped with an indrawn breath, and the door, creaking
abruptly, showed that her weight was heavy on the latch. May stood
still in the yard, as still as the shadow that had once again turned to
ancient stone. The silence that had fallen between them seemed to
push her away, to drive them so far apart that never again would
they be able to speak. At last, in that terrible outpouring, May had
discovered the real barrier to her desire. There were pride and
generosity in the way, but there was also something which she could
not fight. The monstrous, lifelong obsession of Eliza had slopped
even the natural road to a mother's heart.
Fear came over her, a more terrible fear than had taken her on
the sands. In the quiet spot that should have been homely because
of the moving light and the dumb beasts, she had a hint of
something not quite sane. Things that had no place in the life of the
soil seemed suddenly to have forced a passage in. She peered into
the darkness of Sarah's mind, as her bodily eyes sought for her
hidden face.
She was startled into action again by the old dog's nose thrust
kindly into her hand. He had listened to the urgent voices with
constantly pricked ears, knowing by instinct that somebody suffered
and was afraid. Now he came to May, begging her to take charge of
her soul, lest he, too, whose only trust was in Man, should suffer
fear. She laid her hand for a moment on the warmth of his head,
dropping her gaze to meet his upturned eyes. Instantly, however, as
if he had brought her a further message, she looked towards the
bay, and saw the lamp in her father's window spring to life.
She was loth to go with this wreck of things at her feet, but in
her destitution of heart she was afraid to stay. Armed with the
promise, she would have cared nothing for dark or tide, but with this
weight at her heart it seemed as if it would take her all the night to
cross the sand. She tried to believe that she would return to wrestle
with Sarah in the day, but she knew well enough that she would
never return. Eliza, and all that Eliza had meant in their spoiled lives,
lay like a poisonous snake across her path.
She wondered drearily what had become of the passionate
certainty with which she had set out. The sea still sundered her lover
and herself, the bar of the sea so much greater than any possible
stretch of land. There were people to whom the sea was a sort of
curse, and perhaps, without knowing it, she was one of those. She
loved it, indeed, but she never forgot that it had taken her first
hope. Perhaps it mocked at her love as Sarah had mocked her love.
Perhaps it was only waiting out in the dark to do her harm....
She made one last entreating movement towards the shadow
that was stone, but nobody moved in the darkness and nobody
spoke. She could not be sure at that moment whether Sarah was
there, or whether all that she begged of was merely blackened
space. Then she began by degrees to move away, wrenching her
feet, as it were, from the ground of the yard. Sadly, without looking
back, she mounted the sea-wall, bowed by her burden of failure and
sorrow and self-contempt. But the fear took her again as soon as
she faced the sands, and she hurried down the further side. The
good angel of the Thornthwaites fled away into the night as if driven
by flails.

PART IV

GEORDIE-AN'-JIM

The blackness stirred in the doorway and became human again,


setting the door to the jamb with a firm, decisive push. Sarah
followed the dark stone passage to the kitchen, moving with
freedom on the ground she knew. In the bare, silent room, that
seemed at the same time barer and yet more peopled because of
the dusk, she took off her old mantle, her shabby bonnet and her
black thread gloves. She set a lighted candle on the table in the
middle of the room, and from the cupboard by the hearth she took
paper and wood, and kindled a pale, unhomely glow in the dusty,
ash-filled grate. In the outer darkness that was the scullery she filled
the kettle, and brought it to wait the reluctant patronage of the fire.
It was not yet night over the sands, but the candle was more than
sufficient to quench the fainting effort of the day. The only outside
light was the steady glow of the lamp, set in the face of the inn to
call its daughter home.
Still, however, the house seemed unaroused, and would remain
so until the master came in, because those who live much by
themselves do not hear the sound of their own feet. They seem to
themselves to move like ghosts through the rooms; it is only their
thoughts that they hear about the place. And there are no houses so
quiet as those which spend half their days hearkening to that eternal
talker, the sea. The other half of their lives is still as the sands are
still, sharing that same impression of quittance for all time.
The kitchen, once perfectly kept, was already beginning to show
signs of Sarah's failing sight. There were holes in the cloth rug which
she unrolled before the fire, and slits in the patch-work cushions on
the rush-bottomed chairs. The pots in the half-empty pot-rail were
all askew, and the battered pewter and brass had ceased to put in
its claim to be silver and gold. There was an out-of-date almanack
under the old clock, and an ancient tide-table over the mantelshelf.
But the real tragedy of the place was not in its poverty but in its
soul. Behind the lack of material comfort there was a deeper penury
still,--the lack of hope and a forward outlook and a reason for going
on. The place was cold because the hearts of its tenants were
growing cold.
The candle, as always, drove the impression of utter desolation
home. No other light produces that same effect of a helpless battle
against the dark. No other is so surely a symbol of the defiant
human soul, thinking it shines on the vast mysteries of space. No
other shows so clearly the fear of the soul that yet calls its fear by
the name of courage and stands straight, and in the midst of the sea
of the dark cries to all men to behold that courage and take heart.
All about that little challenge of light were the brooding
obscurities of sand and marsh, and, nearer yet, the looming enigma
of the empty house. At the back of the mind there was always the
consciousness of unlit rooms, of echoing passages, and climbing,
creaking stairs. Always at night there is that mystery of terror in a
half-used house, pressing on those who crouch in some charmed
corner of its walls.
Sarah was different, somehow, now that she was at home, and
free of the outdoor-clothes which she had worn all day. It was as if
bonnet and mantle were the armour of her class, in which she was
ready to face the offensive of the world. Without it she was more
primitive and more human, relaxed in muscles and nerves. Now one
could guess at the motherliness in her to which Jim had clung,
unswervingly trusting in spite of her dislike. Her grey hair had been
slightly ruffled both by the bonnet and the drive, and on her old
neck it even curled a little, showing itself still soft and fine.
She was tired with that terrible tiredness which sees the day
behind like a series of folding cardboard views. She seemed to have
lived many days in that single day, with never a moment between
them to fit her for the next. More than once, indeed, she had been
ready to collapse, but always the stimulus of some fresh event had
set her going again. Now she had reached the point when she was
too tired to allow herself to be tired, when body and mind, usually
careful to save the next day's strength, recklessly lay both hands
upon their all.
Even at the last moment had come the sudden struggle with
May, and the zest of that strife still tingled in her veins. After that
long day of damaged pride it was pleasant to have asserted it in the
end, to have claimed the right to suffer rather than be forcibly
blessed. All day she had tasted in prospect the salt savour of
another's bread, but here was something that she could refuse. She
was still too stiff with fight to care that she had wounded a generous
nature in the act. It was true that she could not have borne the sight
of a Geordie who would have brought her fresh disgrace. The love
that cares for the broken more than the sound could not thrive while
she feared the sneer of the idol to whom she would not bow.
Beyond, in the dairy, there came the sound of metalled boots,
and the pails spoke musically on the flags as Simon set them down.
She heard him shuffling across to open the inner door, and then--
"Milk's in, missis!" he called to her, as his head came through.
There was a nervous sound in his voice, at which Sarah almost
smiled, knowing that his conscience must be ill at ease. She
answered "Oh, ay," without turning, for she was busy with the fire,
which, as if hating the atmosphere into which it was born, was doing
its best to escape from it again.
"I'll see to the fire for you, missis," he said, crossing to her side.
"Set you down and be easy a bit. You're likely tired."
"Nay, I'll manage all right," she protested stolidly, and then
suddenly yielded to him, and moved away. She did not sit down,
however, but remained standing on the hearth, while he went on his
knees to set the bellows between the bars.
"May give me a fair start," he observed presently, when the
flame had consented to grow. "What was she after, coming off like
that?"
"Nay, it was nowt much," Sarah said easily, in an indifferent
tone. "It was nobbut some daftness she'd got in her head, that's all."
"She mun ha' been rarely keen to come across so late. Was it
summat or other she wanted you to do?"
"Ay," Sarah said firmly, "but I couldn't see my way. I tellt her so
this morning when I see her in town."
"Summat about your eyes, likely?" he enquired nervously,
blowing hard.
"Losh save us, no! It was nowt to do wi' that."
"Will was rarely put out when I tellt him what doctor had said,"
Simon went on. "He was right sorry, he was, and real anxious to do
what he could."
"Ay, he's kind, is Will. He's a right good friend. But I won't take
owt I can help from him, all the same."
"Because o' yon woman of his?" Simon asked angrily, stumbling
to his feet. He threw a last glance at the fire, and saw that it seemed
resigned to its now evident fate. He was sorry for Sarah, and guiltily
conscious of his own relief, but the thought of Eliza whipped his
mind to rage. This was nothing new, though, either to man or wife,
after the usual meeting at the end of the week. However long they
had held their tongues from her name, it was suddenly out, and the
air was vibrating at once with the rising tremolo of their hate.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like