Skip to main content

A Generative Programming Approach to Developing DSL Compilers

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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 

  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)

    Chapter  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 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  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 

  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)

    MATH  Google Scholar 

  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)

    Article  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  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 

  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)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics