A Generative Programming Approach to Developing DSL Compilers
- 674 Downloads
Domain-Specific Languages (DSLs) represent a proven approach to raising the abstraction level of programming. They offer high-level constructs and notations dedicated to a domain, structuring program design, easing program writing, masking the intricacies of underlying software layers, and guaranteeing critical properties.
On the one hand, DSLs facilitate a straightforward mapping between a conceptual model and a solution expressed in a specific programming language. On the other hand, DSLs complicate the compilation process because of the gap in the abstraction level between the source and target language. The nature of DSLs make their compilation very different from the compilation of common General-Purpose Languages (GPLs). In fact, a DSL compiler generally produces code written in a GPL; low-level compilation is left to the compiler of the target GPL. In essence, a DSL compiler defines some mapping of the high-level information and features of a DSL into the target GPL and underlying layers (e.g., middleware, protocols, objects, ...).
This paper presents a methodology to develop DSL compilers, centered around the use of generative programming tools. Our approach enables the development of a DSL compiler to be structured on facets that represent dimensions of compilation. Each facet can then be implemented in a modular way, using aspects, annotations and specialization. Because these tools are high level, they match the needs of a DSL, facilitating the development of the DSL compiler, and making it modular and re-targetable.
We illustrate our approach with a DSL for telephony services. The structure of the DSL compiler is presented, as well as practical uses of generative tools for some compilation facets.
KeywordsSession Initiation Protocol Generative Programming Execution Environment Telephony Service Session Initiation Protocol Message
Unable to display preview. Download preview PDF.
- 1.Burgy, L., Caillot, L., Consel, C., Latry, F., Réveillère, L.: A comparative study of SIP programming interfaces. In: Proceedings of the ninth International Conference on Intelligence in service delivery Networks (ICIN 2004), Bordeaux, France (October 2004)Google Scholar
- 2.Burgy, L., Consel, C., Latry, F., Lawall, J., Palix, N., Réveillère, L.: Telephony Software Engineering: A Domain-Specific Approach. Research Report RR-5548, INRIA, Bordeaux, France (April 2005)Google Scholar
- 4.Consel, C.: Domain-Specific Program Generation; International Seminar. In: Lengaver, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 19–29. Springer, Heidelberg (2004)Google Scholar
- 5.Consel, C., Danvy, O.: Tutorial notes on partial evaluation. In: Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 493–501. ACM Press, New York (1993)Google Scholar
- 8.Czarnecki, M., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)Google Scholar
- 9.Deruelle, J., Ranganathan, M., Montgomery, D.: Programmable active services for JAIN SIP. Technical report, National Institute of Standards and Technology (June 2004)Google Scholar
- 14.Roach, A.B.: Session Initiation Protocol (SIP)-Specific Event Notification. RFC 3265, IETF (June 2002)Google Scholar
- 15.Rosenberg, J., et al.: SIP: Session Initiation Protocol. RFC 3261, IETF (June 2002)Google Scholar
- 16.Sun Microsystems. The JAIN SIP API specification v1.1. Technical report, Sun Microsystems (June 2003)Google Scholar
- 17.Taha, W.: Domain-Specific Program Generation; International Seminar. In: Lengaver, C., Batory, D., Consel, C., Odersky, M. (eds.) A Gentle Introduction to Multi-stage Programming, State-of-the-Art Survey. LNCS, vol. 3016, pp. 30–50. Springer, Heidelberg (2004)Google Scholar