GPCE 2018
Mon 5 - Tue 6 November 2018 Boston, Massachusetts, United States
co-located with SPLASH 2018
Tue 6 Nov 2018 11:00 - 11:30 at Studio 2 - IV Chair(s): Sebastian Erdweg

Pattern matching is a pervasive and useful feature in functional programming. There have been many attempts to bring similar notions to Object-Oriented Programming (OOP) in the past. However, a key challenge in OOP is how pattern matching can coexist with the open nature of OOP data structures, while at the same time guaranteeing other desirable properties for pattern matching.

This paper discusses several desirable properties for pattern matching in an OOP context, and shows how existing approaches are lacking some of these properties. We argue that the traditional semantics of pattern matching, which is based on the order of patterns and adopted by many approaches, is in conflict with the openness of data structures. Therefore we suggest that a more restricted, top-level pattern matching model, where the order of patterns is irrelevant is worthwhile considering in an OOP context. To compensate for the absence of ordered patterns we propose a complementary mechanism for case analysis with defaults, which can be used when nested and/or multiple case analysis is needed. To illustrate our points we develop Castor: a metaprogramming library in Scala that adopts both ideas. Castor generates code that uses type-safe extensible visitors, and largely removes boilerplate code typically associated with visitors. We illustrate the applicability of our approach with a case study modularizing the interpreters in the famous book “Types and Programming Languages”.

Tue 6 Nov

gpce-2018
10:30 - 12:00: GPCE 2018 - IV at Studio 2
Chair(s): Sebastian ErdwegTU Delft
gpce-201810:30 - 11:00
Talk
Sebastian Ruland, Lars LuthmannTU Darmstadt, Real-time Systems Lab, Johannes BürdekTU Darmstadt, Real-time Systems Lab, Sascha LityTechnische Universität Braunschweig, Thomas ThümTU Braunschweig, Germany, Malte Lochau, Márcio RibeiroFederal University of Alagoas, Brazil
gpce-201811:00 - 11:30
Talk
Weixin ZhangThe University of Hong Kong, Bruno C. d. S. OliveiraThe University of Hong Kong
gpce-201811:30 - 12:00
Talk
Ahmad Salim Al-SibahiDepartment of Computer Science, University of Copenhagen (DIKU) & BilagScan, Thomas P. JensenINRIA Rennes, Aleksandar S. DimovskiIT University of Copenhagen, Denmark, Andrzej WąsowskiIT University of Copenhagen, Denmark