Views: a way for pattern matching to cohabit with data abstraction
POPL '87 Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Concrete syntax for data objects in functional languages
LFP '88 Proceedings of the 1988 ACM conference on LISP and functional programming
Parsers and printers as stream destructors and constructors embedded in functional languages
FPCA '89 Proceedings of the fourth international conference on Functional programming languages and computer architecture
Pizza into Java: translating theory into practice
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Handbook of graph grammars and computing by graph transformation
Meta-programming with Concrete Object Syntax
GPCE '02 Proceedings of the 1st ACM SIGPLAN/SIGSOFT conference on Generative Programming and Component Engineering
IFL '96 Selected Papers from the 8th International Workshop on Implementation of Functional Languages
Red-black trees in a functional setting
Journal of Functional Programming
OOPSLA '04 Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
PADS: a domain-specific language for processing ad hoc data
Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
Statically scoped object adaptation with expanders
Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
PADS/ML: a functional data description language
Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Extensible pattern matching via a lightweight language extension
ICFP '07 Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
Why it's nice to be quoted: quasiquoting for haskell
Haskell '07 Proceedings of the ACM SIGPLAN workshop on Haskell workshop
OMeta: an object-oriented language for pattern matching
Proceedings of the 2007 symposium on Dynamic languages
Journal of Functional Programming
Software Language Engineering
RASCAL: A Domain Specific Language for Source Code Analysis and Manipulation
SCAM '09 Proceedings of the 2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation
A pattern matching compiler for multiple target languages
CC'03 Proceedings of the 12th international conference on Compiler construction
Matchete: paths through the pattern matching jungle
PADL'08 Proceedings of the 10th international conference on Practical aspects of declarative languages
Matching objects with patterns
ECOOP'07 Proceedings of the 21st European conference on Object-Oriented Programming
Hi-index | 0.00 |
For many programmers, the notion of ''pattern matching'' evokes nothing more than regular expressions for matching unstructured text, or technologies such as XPath to match semi-structured data in XML. This common perception of pattern matching is partly due to the success of regular expressions and XPath, which are supported in many popular programming languages today, either as standard libraries or as part of the language. But it is also due to the fact that many programmers never used another elegant form of pattern matching-on structured data, i.e., the native data structures of a programming language. This form of matching is common in functional or logic languages used in the research, but unfortunately much less used in the software industry. It is indeed very surprising that none of the popular languages in use today support, in their standard form, a nearly general form of structured data matching, decades after this technology has been discovered and continuously improved. This paper shows that programmers do not have to wait for next generation languages to integrate pattern matching, neither need they use non-standard pre-processors, thereby losing some advantages that are most important in an industrial setting: official support, compatibility, standardization, etc. Instead, pattern matching of native data in custom notations can be implemented as a minimalist library in popular object languages. Thus, some of the comfortable existing notations from logic languages can be reused, existing standard notations for structured data such as JSON (JavaScript Object Notation) can be smoothly extended to support pattern matching, and new notations can be designed. As in most library implementations of regular expressions, custom notation patterns are simply represented as strings. They can be used in two different modes: interpreted and compiled. This paper presents two open-source implementations of custom matching notations, for Java and JavaScript, exhibiting a reasonable overhead compared to other forms of pattern matching.