用Paisley实现面向对象函数逻辑程序设计中的控制
A Practical Study of Control in Objected-Oriented--Functional--Logic Programming with Paisley
摘要:
Paisley是Java中用于非确定性模式匹配的可扩展轻量级嵌入式领域特定语言。使用简单的API和编程习惯,它将任意数据对象的函数逻辑处理能力带到Java平台,而不约束底层的面向对象语义。在这里,我们提出了一个扩展的佩斯利框架,增加了基于模式的控制流。它利用了Java语言最近增加的功能,即函数接口和lambda表达式,以实现显式和透明的延续传递风格的控制方法。我们评估的实际影响的新功能,对现实世界的案例研究,重新设计的第三方开源项目使用佩斯利在传统的面向对象的数据查询习惯用法。我们发现这种方法对于遗留代码的增量重构是可行的,在关注点分离、清晰度和意图性方面有了显著的质的改进,从而使代码理解、测试和调试变得更容易。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。