Programmers who are lucky enough to use a programming language that features properly integrated pattern matching greatly value the expressivity gain. But, as Jay shows us in this book, we have barely started to properly explore the design landscape of pattern matching in programming languages. More than anyone else, he has systematically explored both the theory and practice of pattern matching. More importantly, the knowledge thus gained has been largely transcribed into this book. Carefully written, it concisely explains the concepts surrounding the integration of pattern matching into both the operational semantics and the type system of two programming paradigms--functional and object-oriented. Finally, this is put into practice in a real programming language, called bondi, created by the author.
The book is divided into three parts. The first one, “Terms,” covers general issues of operational semantics for programming languages, before turning to the semantics and design space for pattern matching. It covers imperative, functional, and object-oriented features, as well as static and dynamic patterns.
“Types,” the second part, essentially goes over the same material; however, this time, it details all of the machinery necessary to lay out a variety of type systems appropriate for the features presented in the previous part. This part is a technically challenging 80 pages; a reader unfamiliar with type systems would be well advised to start with another book [1] before attempting to read this one. Readers familiar with type systems will find this part complete and well written, although still rather dense.
The third part, “Programming in bondi,” is a high-level tutorial on bondi, written in a style appropriate for a reader who is a seasoned programmer in ML and Java and has also read and (generally) understood the first two parts. It is brisk, but well illustrated with examples that demonstrate the power and expressivity of bondi. Furthermore, each chapter systematically ends with some brief notes on relevant related work, both recent and historical.
I appreciated the succinctness of the book, although this density might put off some readers who would have otherwise benefited from reading this material. I would have liked to see more details on the author’s accumulated engineering knowledge on how to build languages with pattern matching and unusual polymorphism. While the author does spend some time doing this, the justification for the design choices is not always entirely transparent, even though one gets the feeling that there are strong reasons for the choices made.
The audience for this book is researchers in programming language design; for them, I highly recommend this book.