Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
Skip header Section
Pattern Calculus: Computing with Functions and StructuresAugust 2009
Publisher:
  • Springer Publishing Company, Incorporated
ISBN:978-3-540-89184-0
Published:12 August 2009
Pages:
213
Skip Bibliometrics Section
Reflects downloads up to 27 Jan 2025Bibliometrics
Skip Abstract Section
Abstract

The pattern calculus is a new foundation for computation, in which the expressive power of functions and of data structures are combined within pattern-matching functions. The best existing foundations focus on either functions, as in the lambda-calculus, or on data structures, as in Turing machines, or on compromises involving both, as in object-orientation. By contrast, a small typed pattern calculus is able to support all the main programming styles, including functional, imperative, object-oriented and query-based styles, and there is evidence that it can support a language for Web services, able to exploit data structures about which almost nothing is known. The book is divided into three parts, on terms, types and programs, and contains many new results. Part I introduces static and then dynamic pattern calculus. The former supports path polymorphic functions, able to traverse arbitrary paths through data structures. It also shows how Lisp is more than just lambda-calculus. The dynamic calculus allows any term to be a pattern, so that patterns can be discovered, combined and simplified on the fly. Part II supportsa family of type systems for pattern calculi that build on novel typings of lambda-calculus. The type system for query calculus allows database queries to be applied uniformly to arbitrary data structures, while still guaranteeing that evaluation terminates. Subtyping and type parameters combine to produce type inequalities, whose solutions provide an expressive account of object-orientation. Also, typing can be made implicit, which simplifies implementation. Part III realises all these ideas in a new programming language, bondi, where the various programming styles can be combined, including algebraic data types and object-oriented classes. This book is useful for researchers with an interest in the foundations of computing, programming language design, the integration of existing programming styles, or the development of new programming styles. The reader is supported throughout with proofs and examples, both in text and in bondi, the source code of which is freely available online.

Cited By

  1. ACM
    Jay B Typed Program Analysis without Encodings Proceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation, (54-65)
  2. ACM
    Jay B A simpler lambda calculus Proceedings of the 2019 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, (1-9)
  3. ACM
    Broman D and Siek J Gradually typed symbolic expressions Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, (15-29)
  4. Viso A, Bonelli E and Ayala-Rincón M (2016). Type Soundness for Path Polymorphism, Electronic Notes in Theoretical Computer Science (ENTCS), 323:C, (235-251), Online publication date: 11-Jul-2016.
  5. ACM
    Roberts M and Sloane A Type inference for the spine view of data Proceedings of the 10th ACM SIGPLAN workshop on Generic programming, (25-34)
  6. ACM
    Solodkyy Y, Dos Reis G and Stroustrup B (2013). Open pattern matching for C++, ACM SIGPLAN Notices, 49:3, (33-42), Online publication date: 5-Mar-2014.
  7. ACM
    Solodkyy Y, Dos Reis G and Stroustrup B Open pattern matching for C++ Proceedings of the 12th international conference on Generative programming: concepts & experiences, (33-42)
  8. ACM
    Given-Wilson T, Huang F and Jay B Multi-polymorphic programming in bondi Proceedings of the 9th ACM SIGPLAN workshop on Generic programming, (53-60)
  9. Petit B (2012). Continuation Models for the Lambda Calculus With Constructors, Electronic Notes in Theoretical Computer Science (ENTCS), 286, (337-350), Online publication date: 1-Sep-2012.
  10. ACM
    Carette J and Stump A Towards typing for small-step direct reflection Proceedings of the ACM SIGPLAN 2012 workshop on Partial evaluation and program manipulation, (93-96)
  11. ACM
    Jay B and Palsberg J Typed self-interpretation by pattern matching Proceedings of the 16th ACM SIGPLAN international conference on Functional programming, (247-258)
  12. ACM
    Jay B and Palsberg J (2011). Typed self-interpretation by pattern matching, ACM SIGPLAN Notices, 46:9, (247-258), Online publication date: 18-Sep-2011.
  13. ACM
    Balabonski T Optimality for dynamic patterns Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming, (231-242)
Contributors
  • University of Technology Sydney

Reviews

Jacques Carette

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. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Recommendations