Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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)
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)
Chander, A., Espinosa, D., Islam, N., Lee, P., Necula, G.C.: Enforcing resource bounds via static verification of dynamic checks. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 311–325. Springer, Heidelberg (2005)
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)
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)
Consel, C., Marlet, R.: Architecturing software using a methodology for language development. In: Palamidessi, C., Meinke, K., Glaser, H. (eds.) ALP 1998 and PLILP 1998. LNCS, vol. 1490, pp. 170–194. Springer, Heidelberg (1998)
Czarnecki, K.: Overview of generative software development. In: Banâtre, J.-P., Fradet, P., Giavitto, J.-L., Michel, O. (eds.) UPP 2004. LNCS, vol. 3566, pp. 326–341. Springer, Heidelberg (2005) (to appear)
Czarnecki, M., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)
Deruelle, J., Ranganathan, M., Montgomery, D.: Programmable active services for JAIN SIP. Technical report, National Institute of Standards and Technology (June 2004)
Jones, N.D., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. International Series in Computer Science, June 1993. Prentice-Hall, Englewood Cliffs (1993)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: Getting started with Aspect J. Communications of the ACM 44(10), 59–65 (2001)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of Aspect J. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)
Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
Roach, A.B.: Session Initiation Protocol (SIP)-Specific Event Notification. RFC 3265, IETF (June 2002)
Rosenberg, J., et al.: SIP: Session Initiation Protocol. RFC 3261, IETF (June 2002)
Sun Microsystems. The JAIN SIP API specification v1.1. Technical report, Sun Microsystems (June 2003)
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)
Thibault, S., Consel, C., Lawall, J., Marlet, R., Muller, G.: Static and dynamic program compilation by interpreter specialization. Higher-Order and Symbolic Computation 13(3), 161–178 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Consel, C., Latry, F., Réveillère, L., Cointe, P. (2005). A Generative Programming Approach to Developing DSL Compilers. In: Glück, R., Lowry, M. (eds) Generative Programming and Component Engineering. GPCE 2005. Lecture Notes in Computer Science, vol 3676. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11561347_4
Download citation
DOI: https://doi.org/10.1007/11561347_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-29138-1
Online ISBN: 978-3-540-31977-1
eBook Packages: Computer ScienceComputer Science (R0)