Hostname: page-component-586b7cd67f-rdxmf Total loading time: 0 Render date: 2024-11-28T22:21:18.188Z Has data issue: false hasContentIssue false

A Module System for Domain-Specific Languages

Published online by Cambridge University Press:  21 July 2014

ETHAN K. JACKSON*
Affiliation:
Research In Software Engineering (RiSE), Microsoft Research, Redmond, WA, USA98052 (e-mail: [email protected])

Abstract

Domain-specific languages (DSLs) are routinely created to simplify difficult or specialized programming tasks. They expose useful abstractions and design patterns in the form of language constructs, provide static semantics to eagerly detect misuse of these constructs, and dynamic semantics to completely define how language constructs interact. However, implementing and composing DSLs is a non-trivial task, and there is a lack of tools and techniques.

We address this problem by presenting a complete module system over LP for DSL construction, reuse, and composition. LP is already useful for DSL design, because it supports executable language specifications using notations familiar to language designers. We extend LP with a module system that is simple (with a few concepts), succinct (for key DSL specification scenarios), and composable (on the level of languages, compilers, and programs). These design choices reflect our use of LP for industrial DSL design. Our module system has been implemented in the formula language, and was used to build key Windows 8 device drivers via DSLs. Though we present our module system as it actually appears in our formula language, our emphasis is on concepts adaptable to other LP languages.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2014 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Aiken, A. and Murphy, B. R. 1991. Implementing Regular Tree Expressions. In FPCA 1991. Springer-Verlag, 427447.Google Scholar
Alvaro, P., Marczak, W. R., Conway, N., Hellerstein, J. M., Maier, D., and Sears, R. 2010. Dedalus: Datalog in Time and Space. In Datalog. 262–281.Google Scholar
Barnett, M. and Schulte, W. 2003. Runtime verification of .NET contracts. Journal of Systems and Software 65, 3, 199208.Google Scholar
Bisztray, D., Heckel, R., and Ehrig, H. 2009. Compositionality of Model Transformations. Electr. Notes Theor. Comput. Sci. 236, 519.CrossRefGoogle Scholar
Börger, E. 2005. Abstract State Machines: a unifying view of models of computation and of system design frameworks. Ann. Pure Appl. Logic 133, 1-3, 149171.Google Scholar
Boronat, A., Heckel, R., and Meseguer, J. 2009. Rewriting Logic Semantics and Verification of Model Transformations. In FASE. 18–33.Google Scholar
Boronat, A. and Meseguer, J. 2010. An algebraic semantics for MOF. Formal Asp. Comput. 22, 3-4, 269296.Google Scholar
Cabot, J., Clarisó, R., and Riera, D. 2007. UMLtoCSP: a tool for the formal verification of UML/OCL models using constraint programming. In ASE. 547–548.Google Scholar
Cardelli, L. 1997. Type Systems. In The Computer Science and Engineering Handbook. 2208–2236.Google Scholar
Cartey, L., Lyngsø, R., and de Moor, O. 2012. Synthesising graphics card programs from DSLs. In PLDI. 121–132.Google Scholar
Desai, A., Gupta, V., Jackson, E. K., Qadeer, S., Rajamani, S. K., and Zufferey, D. 2013. P: safe asynchronous event-driven programming. In PLDI. 321–332.Google Scholar
Dingel, J., Diskin, Z., and Zito, A. 2008. Understanding and improving UML package merge. Software and System Modeling 7, 4, 443467.Google Scholar
Gurevich, Y. 2012. Datalog: A Perspective and the Potential. In Datalog. 9–20.Google Scholar
Haemmerlé, R. and Fages, F. 2006. Modules for Prolog Revisited. In ICLP. 41–55.Google Scholar
Heeren, B., Leijen, D. and van IJzendoorn, A. 2003. Helium, for learning Haskell. In Haskell. 62–71.Google Scholar
Hermenegildo, M. V., Puebla, G., Bueno, F., and López-García, P. 2005. Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor). Sci. Comput. Program. 58, 1-2, 115140.Google Scholar
Horváth, Á., Bergmann, G., Ráth, I., and Varró, D. 2010. Experimental assessment of combining pattern matching strategies with viatra2. STTT 12, 3-4, 211230.Google Scholar
Hudak, P. 1996. Building Domain-Specific Embedded Languages. ACM Computing Surveys 28.Google Scholar
Jackson, E. K., Bjørner, N., and Schulte, W. 2011. Canonical Regular Types. In ICLP (Technical Communications). 73–83.Google Scholar
Jackson, E. K., Kang, E., Dahlweid, M., Seifert, D., and Santen, T. 2010. Components, platforms and possibilities: towards generic automation for MDA. In EMSOFT. 39–48.Google Scholar
Jackson, E. K., Schulte, W., and Bjørner, N. 2012. Detecting Specification Errors in Declarative Languages with Constraints. In MoDELS. 399–414.Google Scholar
Jouault, F. and Bézivin, J. 2006. KM3: A DSL for Metamodel Specification. In FMOODS. 171–185.CrossRefGoogle Scholar
Nienaltowski, P., Meyer, B., and Ostroff, J. S. 2009. Contracts for concurrency. Formal Asp. Comput. 21, 4, 305318.CrossRefGoogle Scholar
Sangiovanni-Vincentelli, A. L., Shukla, S. K., Sztipanovits, J., Yang, G., and Mathaikutty, D. 2009. Metamodeling: An Emerging Representation Paradigm for System-Level Design. IEEE Design & Test of Computers 26, 3, 5469.Google Scholar
Simko, G., Lindecker, D., Levendovszky, T., Neema, S., and Sztipanovits, J. 2013. Specification of Cyber-Physical Components with Formal Semantics - Integration and Composition. In MoDELS. 471–487.Google Scholar
Sulzmann, M., Wazny, J., and Stuckey, P. J. 2006. A Framework for Extended Algebraic Data Types. In FLOPS. 47–64.Google Scholar
Supplementary material: PDF

JACKSON

A Module System for Domain-Specific Languages

Download JACKSON(PDF)
PDF 146.2 KB