PIL: A Platform Independent Language for Retargetable DSLs

  • Zef Hemel
  • Eelco Visser
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5969)


Intermediate languages are used in compiler construction to simplify retargeting compilers to multiple machine architectures. In the implementation of domain-specific languages (DSLs), compilers typically generate high-level source code, rather than low-level machine instructions. DSL compilers target a software platform, i.e. a programming language with a set of libraries, deployable on one or more operating systems. DSLs enable targeting multiple software platforms if its abstractions are platform independent. While transformations from DSL to each targeted platform are often conceptually very similar, there is little reuse between transformations due to syntactic and API differences of the target platforms, making supporting multiple platforms expensive. In this paper, we discuss the design and implementation of PIL, a Platform Independent Language, an intermediate language providing a layer of abstraction between DSL and target platform code, abstracting from syntactic and API differences between platforms, thereby removing the need for platform-specific transformations. We discuss the use of PIL in an implemementation of WebDSL, a DSL for building web applications.


Concrete Syntax Target Platform Partial Classis Abstract Syntax Tree Intermediate Language 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    IronPython website (2009), http://www.ironpython.com
  2. 2.
    IronRuby website (2009), http://www.ironruby.net
  3. 3.
    JRuby website (2009), http://jruby.codehaus.org
  4. 4.
    Jython website (2009), http://www.jython.org
  5. 5.
    PIL website (2009), http://www.pil-lang.org
  6. 6.
    Benitez, M.E., Davidson, J.W.: A portable global optimizer and linker. SIGPLAN Not. 23(7), 329–338 (1988)CrossRefGoogle Scholar
  7. 7.
    Bezivin, J., Hammoudi, S., Lopes, D., Jouault, J.: Applying MDA approach for web service platform. In: EDOC 2004: Proceedings of the Enterprise Distributed Object Computing Conference, Eighth IEEE International, Washington, DC, USA, pp. 58–70. IEEE Computer Society, Los Alamitos (2004)CrossRefGoogle Scholar
  8. 8.
    Bravenboer, M., de Groot, R., Visser, E.: MetaBorg in action: Examples of domain-specific language embedding and assimilation using Stratego/XT. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143, pp. 297–311. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  9. 9.
    Bravenboer, M., Visser, E.: Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In: Schmidt, D.C. (ed.) Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 2004), Vancouver, Canada, pp. 365–383. ACM Press, New York (2004)Google Scholar
  10. 10.
    Chang, F., Dean, J., Ghemawat, S., Hsieh, W.C., Wallach, D.A., Burrows, M., Chandra, T., Fikes, A., Gruber, R.E.: Bigtable: A distributed storage system for structured data. ACM Trans. Comput. Syst. 26(2) (2008)Google Scholar
  11. 11.
    Davidson, J.W., Fraser, C.W.: Code selection through object code optimization. ACM Transactions on Programming Languages and Systems 6(4), 505–526 (1984)CrossRefGoogle Scholar
  12. 12.
    George, L.: MLRISC: Customizable and reusable code generators. Technical report, AT&T Bell Laboratories, Murray Hill, NJ (1997)Google Scholar
  13. 13.
    Groenewegen, D.M., Hemel, Z., Kats, L.C.L., Visser, E.: When frameworks let you down. platform-imposed constraints on the design and evolution of domain-specific languages. In: Gray, J., et al. (eds.) Domain Specific Modelling (DSM 2008), October 2008, pp. 64–66 (2008)Google Scholar
  14. 14.
    Groenewegen, D.M., Visser, E.: Declarative access control for WebDSL: Combining language integration and separation of concerns. In: Schwabe, D., Curbera, F. (eds.) Eighth International Conference on Web Engineering (ICWE 2008), pp. 175–188. IEEE CS Press, Los Alamitos (2008)CrossRefGoogle Scholar
  15. 15.
    Hemel, Z., Kats, L.C.L., Visser, E.: Code generation by model transformation. A case study in transformation modularity. In: Vallecillo, A., Gray, J., Pierantonio, A. (eds.) ICMT 2008. LNCS, vol. 5063, pp. 183–198. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  16. 16.
    Hemel, Z., Verhaaf, R., Visser, E.: WebWorkFlow: An object-oriented workflow modeling language for web applications. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 113–127. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  17. 17.
    Miller, J., Mukerji, J.: MDA guide version 1.0.1 (2003)Google Scholar
  18. 18.
    Muller, P.-A., Studer, P., Bézivin, J.: Platform independent web application modeling. In: Stevens, P., Whittle, J., Booch, G. (eds.) UML 2003. LNCS, vol. 2863, pp. 220–233. Springer, Heidelberg (2003)Google Scholar
  19. 19.
    Parr, T.J., Quong, R.W.: ANTLR: A predicated-LL(k) parser generator. Software Practice and Experience 25, 789–810 (1994)CrossRefGoogle Scholar
  20. 20.
    Peyton Jones, S., Ramsey, N., Reig, F.: C–: A portable assembly language that supports garbage collection. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 1–28. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  21. 21.
    Richards, M.: The portability of the BCPL compiler. Software - Practice and Experience (1971)Google Scholar
  22. 22.
    Semenzato, L.: The high-level intermediate language l. Technical Report UCB/CSD-93-760, EECS Department, University of California, Berkeley (July 1993)Google Scholar
  23. 23.
    Stahl, T., Voelter, M., Czarnecki, K.: Model-Driven Software Development: Technology, Engineering, Management. John Wiley & Sons, Chichester (2006)Google Scholar
  24. 24.
    Steel Jr., T.B.: A first version of UNCOL. In: IRE-AIEE-ACM 1961 (Western): Papers presented at the May 9-11, 1961, western joint IRE-AIEE-ACM computer conference, pp. 371–378. ACM, New York (1961)CrossRefGoogle Scholar
  25. 25.
    UCSD. UCSD p-System and UCSD PASCAL Users Manual. SofTech Microsystems (1981)Google Scholar
  26. 26.
    van den Brand, M., Cornelissen, B., Olivier, P.A., Vinju, J.J.: Tide: A generic debugging framework - tool demonstration. Electr. Notes Theor. Comput. Sci. 141(4), 161–165 (2005)CrossRefGoogle Scholar
  27. 27.
    van Deursen, A., Klint, P., Tip, F.: Origin tracking. Journal of Symbolic Computation 15(5/6), 523–545 (1993)MATHGoogle Scholar
  28. 28.
    van Deursen, A., Klint, P., Visser, J.: Domain-specific languages: an annotated bibliography. ACM SIGPLAN Notices 35(6), 26–36 (2000)CrossRefGoogle Scholar
  29. 29.
    Visser, E.: Scannerless generalized-LR parsing. Technical Report P9707, Programming Research Group, University of Amsterdam (July 1997)Google Scholar
  30. 30.
    Visser, E.: WebDSL: A case study in domain-specific language engineering. In: Lämmel, R., Visser, J., Saraiva, J. (eds.) Generative and Transformational Techniques in Software Engineering II. LNCS, vol. 5235, pp. 291–373. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  31. 31.
    Wu, H., Gray, J., Mernik, M.: Grammar-driven generation of domain-specific language debuggers. Softw. Pract. Exper. 38(10), 1073–1103 (2008)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Zef Hemel
    • 1
  • Eelco Visser
    • 1
  1. 1.Software Engineering Research GroupDelft University of TechnologyThe Netherlands

Personalised recommendations