A Practical Study of Control in Objected-Oriented–Functional–Logic Programming with Paisley

Baltasar Trancón y Widemann
(Ilmenau University of Technology, DE)
Markus Lepper
(semantics GmbH, DE)

Paisley is an extensible lightweight embedded domain-specific language for nondeterministic pattern matching in Java. Using simple APIs and programming idioms, it brings the power of functional-logic processing of arbitrary data objects to the Java platform, without constraining the underlying object-oriented semantics. Here we present an extension to the Paisley framework that adds pattern-based control flow. It exploits recent additions to the Java language, namely functional interfaces and lambda expressions, for an explicit and transparent continuation-passing style approach to control. We evaluate the practical impact of the novel features on a real-world case study that reengineers a third-party open-source project to use Paisley in place of conventional object-oriented data query idioms. We find the approach viable for incremental refactoring of legacy code, with significant qualitative improvements regarding separation of concerns, clarity and intentionality, thus making for easier code understanding, testing and debugging.

In Sibylle Schwarz and Janis Voigtländer: Proceedings 29th and 30th Workshops on (Constraint) Logic Programming and 24th International Workshop on Functional and (Constraint) Logic Programming (WLP'15/'16/WFLP'16), Dresden and Leipzig, Germany, 22nd September 2015 and 12-14th September 2016, Electronic Proceedings in Theoretical Computer Science 234, pp. 150–164.
Published: 1st January 2017.

ArXived at: https://dx.doi.org/10.4204/EPTCS.234.11 bibtex PDF

Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org