...
首页> 外文期刊>LIPIcs : Leibniz International Proceedings in Informatics >EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse
【24h】

EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse

机译:EVF:用于编程语言重用的可扩展表达性访客框架

获取原文
           

摘要

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 programs, 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. Extensible external visitors are able to control traversals with direct access to the data structure being traversed, allowing dependent operations to be defined modularly without the need of advanced type system features. 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.
机译:对象代数是一种设计模式,可在诸如Java之类的主流面向对象语言中实现可扩展性,模块化和重用。对象代数的理论基础扎根于数据类型的Church编码,而后者又与函数编程中的折叠紧密相关。不幸的是,众所周知,某些程序难以编写,并且在使用Church-encodings / folds时可能会导致性能下降。本文介绍了EVF:一个可扩展且表现力强的Java Visitor框架。 EVF支持的访问者可以泛化对象代数,并可以使用一般的递归样式而不是折叠来编写程序。这种一般递归样式的使用使用户能够更自然地编写程序,否则程序将需要使用折叠式结构进行精心设计的变通方法。 EVF访问者保留对象代数的类型安全可扩展性。 EVF的关键进步是一种新颖的技术,可支持可扩展的外部访客。可扩展的外部访问者能够通过直接访问要遍历的数据结构来控制遍历,从而允许以模块化方式定义相关操作,而无需高级类型的系统功能。为了使EVF实用,该框架采用了注释来自动生成大量与访问者和遍历有关的样板代码。为了说明EVF的适用性,我们进行了一个案例研究,该案例从“类型和编程语言”(TAPL)一书中重构了大量非模块解释器。使用EVF,我们能够创建TAPL解释器的模块化软件产品线(SPL),从而实现大部分代码和功能的共享。 TAPL软件产品线包含几个模块化操作,对于使用标准对象代数进行定义而言,这并非易事。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号