Computing Reviews

Open pattern matching for C++
Solodkyy Y., Dos Reis G., Stroustrup B.  GPCE 2013 (Proceedings of the 12th International Conference on Generative Programming: Concepts & Experiences, Indianapolis, IN, Oct 27-28, 2013)33-42,2013.Type:Proceedings
Date Reviewed: 01/29/14

Pattern matching is a powerful technique for mining large code sources to extract complex data patterns. Although the technique itself is well known and implemented in many programming languages and applications, the authors of this paper present a novel approach, implementing pattern matching with an efficient switch function embedded in a C++ library. This approach creates patterns at compile time rather than at run time, so it is more functional than procedural in nature.

The authors claim a generalized increase in efficiency of the code using this approach. The paper first describes the conceptual model behind the function, and then explains how the function is implemented in practice. The core of the technique involves creating patterns as expression templates on which structural and algebraic decomposition are performed. The most interesting part of the paper presents the performance evaluations. These are reported in terms of both structural issues, such as pattern matching and compilation time overhead, and practical ones, such as applying the technique to multi-argument hashing and rewriting Haskell code in C++. Of course, the findings are slightly in favor of this technique, but the conclusions are balanced, also pointing out cases for which this technique is not well suited.

Reviewer:  Andrea Paramithiotti Review #: CR141945 (1405-0365)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy