Skip to main content
main-content

Über dieses Buch

This book is about describing the meaning of programming languages. The author teaches the skill of writing semantic descriptions as an efficient way to understand the features of a language. While a compiler or an interpreter offers a form of formal description of a language, it is not something that can be used as a basis for reasoning about that language nor can it serve as a definition of a programming language itself since this must allow a range of implementations. By writing a formal semantics of a language a designer can yield a far shorter description and tease out, analyse and record design choices.
Early in the book the author introduces a simple notation, a meta-language, used to record descriptions of the semantics of languages. In a practical approach, he considers dozens of issues that arise in current programming languages and the key techniques that must be mastered in order to write the required formal semantic descriptions. The book concludes with a discussion of the eight key challenges: delimiting a language (concrete representation), delimiting the abstract content of a language, recording semantics (deterministic languages), operational semantics (non-determinism), context dependency, modelling sharing, modelling concurrency, and modelling exits.
The content is class-tested and suitable for final-year undergraduate and postgraduate courses. It is also suitable for any designer who wants to understand languages at a deep level. Most chapters offer projects, some of these quite advanced exercises that ask for complete descriptions of languages, and the book is supported throughout with pointers to further reading and resources. As a prerequisite the reader should know at least one imperative high-level language and have some knowledge of discrete mathematics notation for logic and set theory.

Inhaltsverzeichnis

Frontmatter

Chapter 1. Programming languages and their description

Abstract
This chapter sets the scene for the rest of the book. Sections 1.1–1.3 outline the problems presented by programming languages and their related tools; Section 1.4 points out that there is material from the study of natural languages that is relevant to the problems of describing artificial languages such as those used to program computers; an overview of a range of techniques for recording the meaning of programming languages is given in Section 1.5 and Section 1.6 introduces the specific notation used throughout this book.
Cliff B. Jones

Chapter 2. Delimiting a language

Abstract
The body of this book addresses the task of describing –or designing– the semantics of programming languages. This chapter prepares the way for that task by introducing the division between syntax and semantics.
Cliff B. Jones

Chapter 3. Operational semantics

Abstract
Chapter 2 shows how to delimit texts in a language by using a syntax meta-language. This chapter moves on to the problem of fixing the meaning of texts in languages by using a semantic meta-language.
Cliff B. Jones

Chapter 4. Constraining types

Abstract
In early versions of FORTRAN, the type of a variable was determined by the first letter of its identifier. This chapter shows how to describe an object language that expands on the idea of listing the permissible names of variables and looks at the advantages of declaring a specific type for each variable.
Cliff B. Jones

Chapter 5. Block structure

Abstract
Section 4.3 emphasises the important role that semantic objects can play in understanding or, indeed, designing a programming language. This point becomes more obvious as the language challenges increase.
Cliff B. Jones

Chapter 6. Further issues in sequential languages

Abstract
As made clear at the beginning of this book, it is not the aim to cover all possible language challenges. This chapter mentions some interesting extensions to languages and either sketches an approach to their models or provides references to where such models are developed.
Cliff B. Jones

Chapter 7. Other semantic approaches

Abstract
The main focus in this book is on the operational approach to documenting the semantics of programming languages. There are however other approaches and understanding them is both instructive in itself and also throws light on operational semantics by clarifying their relationship thereto.
Cliff B. Jones

Chapter 8. Shared-variable concurrency

Abstract
This chapter moves beyond issues present in sequential languages typified by ALGOL descendants. The topic of concurrency is important and challenging in many ways.
Cliff B. Jones

Chapter 9. Concurrent OOLs

Abstract
Although it is essential that specification methods are capable of describing languages –such as that outlined in Section 8.2– that permit unconstrained access to shared variables, it is more advantageous to use the description techniques to understand –and potentially design– languages that embody tractable concurrency.
Cliff B. Jones

Chapter 10. Exceptional ordering

Abstract
This short optional chapter addresses the topic of modelling statements that cause execution to occur in orders different from their textual juxtaposition. The controversial goto statement provides the classic example of this modelling challenge but it is not the only manifestation of the difficulty.
Cliff B. Jones

Chapter 11. Conclusions

Abstract
This short concluding chapter begins with a review of the eight challenges discussed in the body of this book; this is followed by comments on some significant formal language descriptions or specifications.
Cliff B. Jones

Backmatter

Weitere Informationen