EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse
Object Algebras are a design pattern that enables extensibility, modularity and reuse in mainstream Object- Oriented languages such as Java. The theoretical foundations of Object Algebras are rooted on Church encodings of datatypes, which are in turn closely related to folds in functional programming. Unfortunately, it is well-known that certain programs are difficult to write, and may incur performance penalties, when using Church-encodings/folds. This paper presents EVF: an extensible and expressive Java VISITOR framework. The visitors supported by EVF generalize Object Algebras and enable writing programs using a generally recursive style rather than folds. The use of such generally recursive style enables users to more naturally write pro- grams, which would otherwise require contrived workarounds using a fold-like structure. EVF visitors retain the type-safe extensibility of Object Algebras. The key advance in EVF is a novel technique to support extensible external visitors, which are able to control traversals with direct access to the data structure being traversed. To make EVF practical, the framework employs annotations to automatically generate large amounts of boilerplate code related to visitors and traversals. To illustrate the applicability of EVF we conduct a case study, which refactors a large number of non-modular interpreters from the “Types and Programming Languages” (TAPL) book. Using EVF we are able to create a modular software product line (SPL) of the TAPL interpreters, enabling sharing of large portions of code and features. The TAPL software product line contains several modular operations, which would be non-trivial to define with standard Object Algebras.
Fri 23 JunDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
13:40 - 15:20 | Language and Library DesignECOOP Research Papers at Auditorium, Vertex Building Chair(s): Sophia Drossopoulou Imperial College London | ||
13:40 25mTalk | IceDust 2: Derived Bidirectional Relations and Calculation Strategy Composition ECOOP Research Papers Link to publication DOI Media Attached | ||
14:05 25mTalk | Mixed Messages: Measuring Conformance and Non-Interference in TypeScript ECOOP Research Papers Jack Williams University of Edinburgh, J. Garrett Morris University of Edinburgh, UK, Philip Wadler University of Edinburgh, UK, Jakub Zalewski Link to publication Media Attached | ||
14:30 25mTalk | EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse ECOOP Research Papers Link to publication Media Attached | ||
14:55 25mTalk | Data exploration through dot-driven development ECOOP Research Papers Tomas Petricek Alan Turing Institute Link to publication Media Attached |