arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1703.10873cs.PLcs.SE
收藏

开放式程序设计语言解释器

Open Programming Language Interpreters

Walter Cazzola, Albert Shaqiri

摘要:

内容:本文提出了开放式程序设计语言解释器的概念,并实现了一个框架级元对象协议(MOP)来支持它们。询价:我们解决了动态解释器适应的问题,以调整解释器的行为上的任务要解决的问题,并引入新的功能,以满足不可预见的要求。许多语言都提供了在某种程度上支持反射的MOP。然而,MOP通常是特定于语言的,它们的反射功能通常受到限制,并且适配和应用逻辑通常是混合的,这使得对源代码的理解和维护变得困难。我们的系统克服了这些限制。方法:我们设计并实现了一个支持开放式程序设计语言解释器的系统。原型实现集成在Neverlang框架中。该系统公开了任何基于Neverlang的解释器的结构、行为和运行时状态,并能够对其进行修改。知识:我们的系统提供了对解释器的结构、行为和运行时状态的完全控制。该方法适用于所有基于Neverlang的解释器。适配代码可以在不同的语言实现中重用。基础:有了原型实现,我们专注于可行性评估。该文件表明,我们的方法很好地解决了研究文献中常见的问题。我们有一个演示视频和例子,说明我们的方法动态软件自适应,面向方面的编程,调试和上下文感知解释器。重要性:据我们所知,我们的论文提出了针对语言发展的一般框架的第一种反思方法。我们的系统免费为任何基于Neverlang的解释器提供完全的反射支持。我们不知道任何开放式实现在本文定义的意义上的程序设计语言解释器的先前应用。而不是替代其他方法,我们相信我们的系统可以作为一种补充技术的情况下,其他方法存在严重的局限性。

英文摘要:

Context: This paper presents the concept of open programming language interpreters and the implementation of a framework-level metaobject protocol (MOP) to support them. Inquiry: We address the problem of dynamic interpreter adaptation to tailor the interpreter's behavior on the task to be solved and to introduce new features to fulfill unforeseen requirements. Many languages provide a MOP that to some degree supports reflection. However, MOPs are typically language-specific, their reflective functionality is often restricted, and the adaptation and application logic are often mixed which hardens the understanding and maintenance of the source code. Our system overcomes these limitations. Approach: We designed and implemented a system to support open programming language interpreters. The prototype implementation is integrated in the Neverlang framework. The system exposes the structure, behavior and the runtime state of any Neverlang-based interpreter with the ability to modify it. Knowledge: Our system provides a complete control over interpreter's structure, behavior and its runtime state. The approach is applicable to every Neverlang-based interpreter. Adaptation code can potentially be reused across different language implementations. Grounding: Having a prototype implementation we focused on feasibility evaluation. The paper shows that our approach well addresses problems commonly found in the research literature. We have a demonstrative video and examples that illustrate our approach on dynamic software adaptation, aspect-oriented programming, debugging and context-aware interpreters. Importance: To our knowledge, our paper presents the first reflective approach targeting a general framework for language development. Our system provides full reflective support for free to any Neverlang-based interpreter. We are not aware of any prior application of open implementations to programming language interpreters in the sense defined in this paper. Rather than substituting other approaches, we believe our system can be used as a complementary technique in situations where other approaches present serious limitations.

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

↑