论文标题

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

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

论文作者

Costiou, Steven, Aranega, Vincent, Denker, Marcus

论文摘要

语境。精炼或改变现有行为是每个开发人员的日常工作,但不能总是可以预料到,并且软件有时无法停止。在这种情况下,对于许多情况,对运行系统的意外改编是有趣的,从功能性升级到对关键应用程序的正式调试或监视。 询问。在运行时间更改软件的一种方法是使用行为反射,这特别适合于现实世界系统的意外改编。部分行为反思并不是一个新想法,多年来,已经做出了许多努力来表达一种实用的方式。所有这些努力都导致了实用的解决方案,但在需要适应和部分行为的表达的代码之间引入了语义差距。例如,在面向方面的编程中,用另一种语言表达了一个尖端描述,该语言本身引入了行为表达式(建议)和源代码本身之间的新距离。 方法。十年前,缩小代码和部分行为表达之间差距的想法导致了反射率框架的实现。使用反射率,开发人员注释了带有元行为的抽象语法树(AST)节点,这些节点由编译器考虑到产生行为变化。在本文中,我们介绍了反射率,其API,其实施和在Pharo中的用法。我们反思了十年的反射率,并展示了它如何用作许多创新思想的基本构建基础。 知识。反射率带来了一种在AST级别工作的实用方法,这是软件开发人员操纵的源代码的高级表示。它可以动态添加和修改行为的强大方法。反射率也是一种灵活的均值,可以弥合元行为和源代码的表达之间的差距。这种应用意外适应并提供行为反思的能力导致了过去十年来外部用户的许多实验和项目。现有的工作使用反射率来实施反思性库或语言扩展,轻量级代码仪器,动态软件更新,调试工具以及可视化和软件分析工具。 接地。反射率在研究项目中积极使用。在过去的十年中,它是实施或作为基本基础的支持,用于许多研究工作,包括博士学位论文,会议,期刊和研讨会论文。反射率现在是Pharo语言的重要库,并且是平台的核心。 重要性。反射率暴露了强大的抽象来处理部分行为适应,同时为基于AST注释的意外,无侵入和部分行为反思提供了一个成熟的框架。此外,即使反射率在Pharo内部找到了家园,它也不是纯粹面向小型的解决方案。作为对动态面向对象语言中反射率的实际使用的验证,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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源