Advertisement

A Generative Programming Approach to Developing DSL Compilers

  • Charles Consel
  • Fabien Latry
  • Laurent Réveillère
  • Pierre Cointe
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3676)

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.

Keywords

Session Initiation Protocol Generative Programming Execution Environment Telephony Service Session Initiation Protocol Message 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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. 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
  3. 3.
    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)CrossRefGoogle Scholar
  4. 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. 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
  6. 6.
    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)CrossRefGoogle Scholar
  7. 7.
    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)CrossRefGoogle Scholar
  8. 8.
    Czarnecki, M., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)Google Scholar
  9. 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
  10. 10.
    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)zbMATHGoogle Scholar
  11. 11.
    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)CrossRefGoogle Scholar
  12. 12.
    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)CrossRefGoogle Scholar
  13. 13.
    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)CrossRefGoogle Scholar
  14. 14.
    Roach, A.B.: Session Initiation Protocol (SIP)-Specific Event Notification. RFC 3265, IETF (June 2002)Google Scholar
  15. 15.
    Rosenberg, J., et al.: SIP: Session Initiation Protocol. RFC 3261, IETF (June 2002)Google Scholar
  16. 16.
    Sun Microsystems. The JAIN SIP API specification v1.1. Technical report, Sun Microsystems (June 2003)Google Scholar
  17. 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
  18. 18.
    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)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Charles Consel
    • 1
  • Fabien Latry
    • 1
  • Laurent Réveillère
    • 1
  • Pierre Cointe
    • 2
  1. 1.INRIA / LaBRITalenceFrance
  2. 2.École des Mines de NantesNantesFrance

Personalised recommendations