ABSTRACT
Domain-Specific Languages (DSL's) offer language-level abstractions that General-Purpose Languages do not offer, thus speeding up the implementation of the solution of problems within a specific domain. Developers have the choice of developing a DSL by building an interpreter/compiler for it, which is a hard and time-consuming task, or embedding it in a host language, thus speeding up the development process but losing several advantages that having a dedicated compiler might bring. In this work we present a meta-compiler called Metacasanova, whose meta-language is based on operational semantics. Then, we propose a language extension with functors and modules that allows to embed the type system of a language definition inside the meta-type system of Metacasanova and improves the performance of manipulating data structures at run-time. Our results show that Metacasanova dramatically reduces the code lines required to develop a compiler, and that the running time of the Meta-program is improved by embedding the host language type system in the meta-type system with the use of functors in the meta-language.
- Mohamed Abbadi. 2017. Casanova 2, A domain specific language for general game development. Ph.D. Dissertation. Università Ca’ Foscari, Tilburg University.Google Scholar
- Mohamed Abbadi, Francesco Di Giacomo, Agostino Cortesi, Pieter Spronck, Giulia Costantini, and Giuseppe Maggiore. 2015. Casanova: a simple, high-performance language for game development. In Joint International Conference on Serious Games. Springer, 123–134. Google ScholarCross Ref
- Alfred V Aho, Ravi Sethi, and Jeffrey D Ullman. 1986. Compilers, Principles, Techniques. Addison wesley Boston.Google Scholar
- Erwin Book, Dewey Val Shorre, and Steven J Sherman. 1970. The cwic/36o system, a compiler for writing and implementing compilers. ACM SIGPLAN Notices 5, 6 (1970), 11–29. Google ScholarDigital Library
- Martin Bravenboer, Karl Trygve Kalleberg, Rob Vermaas, and Eelco Visser. 2008. Stratego/XT 0.17. A language and toolset for program transformation. Science of computer programming 72, 1 (2008), 52–70. Google ScholarDigital Library
- WR Campbell. 1978. A compiler definition facility based on the syntactic macro. Comput. J. 21, 1 (1978), 35–41. Google ScholarCross Ref
- Luca Cardelli. 1996. Type systems. Comput. Surveys 28, 1 (1996), 263–264. Google ScholarDigital Library
- Krzysztof Czarnecki, Ulrich W Eisenecker, G Goos, J Hartmanis, and J van Leeuwen. 2000. Generative programming. Edited by G. Goos, J. Hartmanis, and J. van Leeuwen 15 (2000).Google Scholar
- Francesco Di Giacomo, Mohamed Abbadi, Agostino Cortesi, Pieter Spronck, and Giuseppe" Maggiore. 2017. Building Game Scripting DSL’s with the Metacasanova Metacompiler. In INTETAIN 2016, Utrecht, The Netherlands, June 28–30. Springer, 231–242.Google Scholar
- Figure 1. Execution time of the different memory modelsGoogle Scholar
- Plotkin G.D. 1981. A structural approach to operational semantics. Technical Report. Computer science department, Aarhus University. Google Scholar
- F. Di Giacomo, M. Abbadi, A. Cortesi, P. Spronck, G. Costantini, and G. Maggiore. 2017. High performance encapsulation and networking in Casanova 2. Entertainment Computing 20 (2017), 25 – 41. Google ScholarCross Ref
- Gilles Kahn. 1987. Natural semantics. STACS 87 (1987), 22–39. Google ScholarCross Ref
- Samuel N Kamin. 1998. Research on domain-specific embedded languages and program generators. Electronic Notes in Theoretical Computer Science 14 (1998), 149–168.Google ScholarCross Ref
- O. Kiselyov. 2016. Free and Freer Monads: Putting Monads Back into Closet. http://okmij.org/ftp/Computation/free-monad.html . (2016).Google Scholar
- Jan Willem Klop et al. 1992. Term rewriting systems. Handbook of logic in computer science 2 (1992), 1–116.Google Scholar
- Marjan Mernik, Jan Heering, and Anthony M Sloane. 2005. When and how to develop domain-specific languages. ACM computing surveys (CSUR) 37, 4 (2005), 316–344. Google ScholarCross Ref
- Mikael Pettersson. 1996. A compiler for natural semantics. In Compiler Construction. Springer, 177–191.Google Scholar
- Tim Sheard and Simon Peyton Jones. 2002. Template metaprogramming for Haskell. In Proceedings of the 2002 ACM SIGPLAN workshop on Haskell. ACM, 1–16.Google ScholarDigital Library
- Anthony M Sloane. 2002. Post-design domain-specific language embedding: A case study in the software engineering domain. In System Sciences, 2002. HICSS. Proceedings of the 35th Annual Hawaii International Conference on. IEEE, 3647–3655. Google ScholarDigital Library
- Arie Van Deursen, Paul Klint, Joost Visser, et al. 2000. Domain-specific languages: An annotated bibliography. Sigplan Notices 35, 6 (2000), 26–36.Google ScholarDigital Library
- Markus Voelter, Sebastian Benz, Christian Dietrich, Birgit Engelmann, Mats Helander, Lennart CL Kats, Eelco Visser, and Guido Wachsmuth. 2013. DSL engineering: Designing, implementing and using domainspecific languages. dslbook. org.Google Scholar
- Daniel Weise and Roger Crew. 1993. Programmable syntax macros. In ACM SIGPLAN Notices, Vol. 28. ACM, 156–165.Google ScholarDigital Library
Index Terms
- Metacasanova: an optimized meta-compiler for domain-specific languages
Recommendations
Bootstrapping domain-specific meta-languages in language workbenches
GPCE 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesIt is common practice to bootstrap compilers of programming languages. By using the compiled language to implement the compiler, compiler developers can code in their own high-level language and gain a large-scale test case. In this paper, we ...
Bootstrapping domain-specific meta-languages in language workbenches
GPCE '16It is common practice to bootstrap compilers of programming languages. By using the compiled language to implement the compiler, compiler developers can code in their own high-level language and gain a large-scale test case. In this paper, we ...
Macros for domain-specific languages
Macros provide a powerful means of extending languages. They have proven useful in both general-purpose and domain-specific programming contexts. This paper presents an architecture for implementing macro-extensible DSLs on top of macro-extensible host ...
Comments