Language Oriented Modularity: From Theory to Practice

Arik Hadas, David H. Lorenz

Research output: Contribution to journalArticlepeer-review

Abstract

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 work-benches, DSAL development lacks similar tool support. Consequently, LOM is often impractical and underuti-lized. A challenge for LOM is making the complexity of implementing DSALs 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. AspectJ development tools do not work on DSAL code. Language workbenches neither deal with the back-end weaving nor handle the composition of DSALs. DSAL composition frameworks do not provide front-end development tools. DSAL code transformation approaches do not preserve the semantics of DSAL programs in the presence of other aspect languages. To address this challenge we extend AspectJ with a small set of annotations and interfaces that allows DSAL designers to define a semantic-preserving transformation to AspectJ. We present a transformation approach that enables the use of a standard language workbench to implement DSALs and the use of standard aspect development tools to program with these DSALs. With our approach, DSALs regain their 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. As validation, we modified the ajc compiler to support our approach and used it as back-end for two different language workbenches. With Spoofax we implemented Cool to demonstrate that the non-trivial composition of AspectJ and Cool can be accommodated using our approach. With Xtext 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 the use of DSAL solutions in the software development process.

Original languageEnglish
JournalArt, Science, and Engineering of Programming
Volume1
Issue number2
DOIs
StatePublished - 2017

Bibliographical note

Funding Information:
Acknowledgment This research was supported in part by the Israel Science Foundation (ISF) under grant No. 1440/14.

Publisher Copyright:
© Arik Hadas and David H. Lorenz.

Keywords

  • Aspect-oriented programming (AOP)
  • Domain-specific languages (DSLs)
  • Language-oriented programming (LOP)

Fingerprint

Dive into the research topics of 'Language Oriented Modularity: From Theory to Practice'. Together they form a unique fingerprint.

Cite this