arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2002.06182cs.PL
收藏

子方法,部分行为反射与反射率:回顾10年的使用

Sub-method, partial behavioral reflection with Reflectivity: Looking back on 10 years of use

Steven Costiou, Vincent Aranega, Marcus Denker

摘要:

上下文改进或改变现有的行为是每个开发人员的日常工作,但这并不总是可以预期的,软件有时也不能停止。在这种情况下,运行系统的意外适应对于许多场景都很重要,从功能升级到关键应用程序的实时调试或监控。查询在运行时间改变软件的一种方法是使用行为反射,这特别适合于现实世界系统的意外适应。部分行为反射并不是一个新的想法,多年来,人们一直在努力提出一种实用的表达方式。所有这些努力都产生了实用的解决方案,但在需要调整的代码和部分行为的表达之间引入了语义鸿沟。例如,在面向Advance的编程中,切入点描述是用另一种语言表达的,这在行为表达式(Advice)和源代码本身之间引入了一个新的距离。Approach.十年前,缩小代码和部分行为表达之间差距的想法导致了反射框架的实现。使用Reflectivity,开发人员用元行为注释抽象树(AST)节点,编译器考虑这些元行为以产生行为变体。在本文中,我们介绍了反射率,它的API,它的实现和它在Pharo中的使用。我们回顾了Reflectivity十年来的使用情况,并展示了它如何被用作许多创新想法的基本构建块。知识反射带来了一种在AST级别工作的实用方法,AST级别是软件开发人员操纵的源代码的高级表示。它提供了一种强大的动态添加和修改行为的方法。反射性也是一种灵活的手段,可以弥合元行为的表达与源代码之间的差距。在过去的十年里,这种应用意外适应和提供行为反射的能力导致了外部用户的许多实验和项目。现有的工作使用反射实现反射库或语言扩展,轻量级代码插装,动态软件更新,调试工具和可视化和软件分析工具。接地。反射率在研究项目中得到了积极的应用。在过去的十年里,它作为一个支持,无论是实施或作为一个基本的基础,许多研究工作,包括博士论文,会议,期刊和研讨会论文。Reflectivity现在是Pharo语言的一个重要库,并集成在平台的核心。重要性Reflectivity公开了强大的抽象来处理部分行为适应,同时提供了一个成熟的框架,用于基于AST注释的非预期,非侵入性和部分行为反射。此外,即使Reflectivity在Pharo中找到了自己的家,它也不是一个纯粹的面向Smalltalk的解决方案。作为对动态面向对象语言中反射率实际使用的验证,API已被移植到Python。最后,反射率的AST注释特性为开发人员提供了新的实验机会,可以控制他们自己软件的行为。

英文摘要:

Context. Refining or altering existing behavior is the daily work of every developer, but that cannot be always anticipated, and software sometimes cannot be stopped. In such cases, unanticipated adaptation of running systems is of interest for many scenarios, ranging from functional upgrades to on-the-fly debugging or monitoring of critical applications. Inquiry. A way of altering software at run time is using behavioral reflection, which is particularly well-suited for unanticipated adaptation of real-world systems. Partial behavioral reflection is not a new idea, and for years many efforts have been made to propose a practical way of expressing it. All these efforts resulted in practical solutions, but which introduced a semantic gap between the code that requires adaptation and the expression of the partial behavior. For example, in Aspect-Oriented Programming, a pointcut description is expressed in another language, which introduces a new distance between the behavior expression (the Advice) and the source code in itself. Approach. Ten years ago, the idea of closing the gap between the code and the expression of the partial behavior led to the implementation of the Reflectivity framework. Using Reflectivity, developers annotate Abstract Syntax Tree (AST) nodes with meta-behavior which is taken into account by the compiler to produce behavioral variations. In this paper, we present Reflectivity, its API, its implementation and its usage in Pharo. We reflect on ten years of use of Reflectivity, and show how it has been used as a basic building block of many innovative ideas. Knowledge. Reflectivity brings a practical way of working at the AST level, which is a high-level representation of the source code manipulated by software developers. It enables a powerful way of dynamically add and modify behavior. Reflectivity is also a flexible mean to bridge the gap between the expression of the meta-behavior and the source code. This ability to apply unanticipated adaptation and to provide behavioral reflection led to many experiments and projects during this last decade by external users. Existing work use Reflectivity to implement reflective libraries or languages extensions, featherweight code instrumentation, dynamic software update, debugging tools and visualization and software analysis tools. Grounding. Reflectivity is actively used in research projects. During the past ten years, it served as a support, either for implementation or as a fundamental base, for many research work including PhD theses, conference, journal and workshop papers. Reflectivity is now an important library of the Pharo language, and is integrated at the heart of the platform. Importance. Reflectivity exposes powerful abstractions to deal with partial behavioral adaptation, while providing a mature framework for unanticipated, non-intrusive and partial behavioral reflection based on AST annotation. Furthermore, even if Reflectivity found its home inside Pharo, it is not a pure Smalltalk-oriented solution. As validation over the practical use of Reflectivity in dynamic object-oriented languages, the API has been ported to Python. Finally, the AST annotation feature of Reflectivity opens new experimentation opportunities about the control that developers could gain on the behavior of their own software.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑