Abstract

A great part of software development challenges can be solved by one universal tool: Abstraction. Developers solve development challenges by using expressions and concepts that abstract from too technical details. One especially supportive tool for abstraction are domain-specific languages (DSLs). DSLs are specifically crafted languages that support abstraction in two ways. On the one side, they abstract from the (real-world) concepts of the domain by introducing objects with structure and behavior that are representative for the domain. On the other side, they abstract from a programming language and do not depend on hardware-specific details. We focus on internal DSLs, which are build on top of an existing host language. Such DSLs can completely use the development tools of their host, are quick to build because they reuse existing abstractions, and can be easily integrated with other programs, libraries, and DSLs of the same host.Developing DSLs is challenging. Especially dynamic object-oriented programming languages like Ruby and Python are used as hosts for DSLs. In these languages, DSLs exploit syntactic variations of the host to express domain-specific notations, and they access the host's reflective facilities and metaprogramming capabilities to implement the domain semantics. Although there are several case studies for DSLs, explanation of a DSLs design and implementation uses mostly host-specific terminology. Here we identify two particular challenge. First, the DSLs design intent is explained too specific to the particular DSL, making it difficult to reuse explained techniques to develop DSLs in another domain. Second, because the DSL design is explained with techniques native to the used host language, it is difficult to transfer these techniques to other host languages. In the long term, this could lead to fragmented islands of DSL design knowledge.Our solution to these challenges is to provide a host-language independent catalog of design principles and design patterns for DSLs. Particularly, this paper contributes six design principles and nine notation patterns for DSLs. The patterns have been found in 12 DSLs of the three host languages Ruby, Python, and Scala.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call