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

面向语言的模块化:从理论到实践

Language Oriented Modularity: From Theory to Practice

Arik Hadas, David H Lorenz

摘要:

面向数据库的模块化(LOM)是一种在软件开发过程中提供按需语言抽象解决方案的方法论,它补充了面向语言的编程(LOP)。它涉及特定领域语言(DSL)的实现和直接利用,这些语言也是面向方面的(DSAL)。然而,由于现代语言工作台,DSL开发是负担得起的,而DSAL开发缺乏类似的工具支持。因此,LOM通常不切实际且未得到充分利用。我们所面临的挑战是使DSAL实现的复杂性与DSL的复杂性相媲美,并使DSAL编程的有效性与通用方面语言(GPAL)的有效性相媲美。今天,尽管DSAL本质上是特定于领域和面向方面的,但它似乎是二等的。方面开发工具(例如,AJDT)不适用于DSAL代码。DSL开发工具,如语言工作台(例如,Spoofax)既不处理后端织入,也不处理DSAL的组成。DSAL组成框架(例如,Awesome)不提供前端开发工具。DSAL代码转换方法(例如,XAspects)在其他方面语言存在的情况下不保留DSAL程序的语义。我们扩展了一个小的注释和接口,允许DSAL设计师定义一个语义保留的转换到AAJJ和接口与AAJJ工具。我们的转换方法使使用标准语言工作台实现DSAL和使用标准方面开发工具与这些DSAL编程。因此,DSAL重新获得了DSL和方面语言的一流地位。这一方面降低了将DSAL开发到DSL水平的成本,另一方面提高了使用DSAL到GPAL水平的有效性。因此,与LOP基线相比,LOM变得具有成本效益。我们修改了ajc编译器来支持我们的方法。使用两种不同的语言工作台(Spoofax和Xtext),然后我们实现了几个DSAL。ANOJ是开箱即用的支持。我们实现了Cool,以证明使用我们的方法可以容纳ANOJ和Cool的非平凡组合。我们在两个开源项目(oVirt和muCommander)中将LOM应用于横切关注点,在过程中实施特定于应用程序的DSAL,从而降低了开发可组合DSAL的成本,并提高了使用它们编程的有效性。横切关注点仍然是现代现实世界项目中的一个问题(例如,如在oVirt中观察到的)。DSAL通常是解决这些问题的正确工具。我们的工作使LOM实用,从而促进在软件开发过程中使用DSAL解决方案。

英文摘要:

Language-oriented modularity (LOM) is a methodology that complements language-oriented programming (LOP) in providing on-demand language abstraction solutions during software development. It involves the implementation and immediate utilization of domain-specific languages (DSLs) that are also aspect-oriented (DSALs). However, while DSL development is affordable thanks to modern language workbenches, DSAL development lacks similar tool support. Consequently, LOM is often impractical and underutilized. The challenge we address is making the complexity of DSAL implementation comparable to that of DSLs and the effectiveness of programming with DSALs comparable to that of general-purpose aspect languages (GPALs). Today, despite being essentially both domain-specific and aspect-oriented, DSALs seem to be second-class. Aspect development tools (e.g., AJDT) do not work on DSAL code. DSL development tools like language workbenches (e.g., Spoofax) neither deal with the backend weaving nor handle the composition of DSALs. DSAL composition frameworks (e.g., Awesome) do not provide frontend development tools. DSAL code transformation approaches (e.g., XAspects) do not preserve the semantics of DSAL programs in the presence of other aspect languages. We extend AspectJ with a small set of annotations and interfaces that allows DSAL designers to define a semantic-preserving transformation to AspectJ and interface with AspectJ tools. Our transformation approach enables the use of standard language workbench to implement DSALs and use of standard aspect development tools to program with those DSALs. As a result, DSALs regain first-class status with respect to both DSLs and aspect languages. This, on the one hand, lowers the cost of developing DSALs to the level of DSLs and, on the other hand, raises the effectiveness of using a DSAL to the level of a GPAL. Consequently, LOM becomes cost-effective compared to the LOP baseline. We modified the ajc compiler to support our approach. Using two different language workbenches (Spoofax and Xtext) we then implemented several DSALs. AspectJ was supported out-of-the-box. We implemented Cool to demonstrate that the non-trivial composition of AspectJ and Cool can be accommodated using our approach. We applied LOM to crosscutting concerns in two open source projects (oVirt and muCommander), implementing in the process application-specific DSALs, thus providing a sense of the decrease in the cost of developing composable DSALs and the increase in the effectiveness of programming with them. Crosscutting concerns remain a problem in modern real-world projects (e.g., as observed in oVirt). DSALs are often the right tool for addressing these concerns. Our work makes LOM practical, thus facilitating use of DSAL solutions in the software development process.

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

↑