DSLs for Software Engineering
2 Domain Specific Languages
- http://martinfowler.com/books/dsl.html "DSLs are small languages,
focused on a particular aspect of a software system. You can't
build a whole program with a DSL, but you often use multiple DSLs
in a system mainly written in a general purpose language." Reference.
- Building a software product requires knowledge in both software
engineering and the domain the software is written for.
- However, common software engineering methods in fact exclude
domain experts from the architectural design of a software
system, because the generality of the notations defined by
these methods require expert knowledge in the field of
software engineering and especially software architecture.
- In order to avoid this effect, domain-specific languages
(DSL) have been proposed as an alternative to the general
purpose languages being normally used in software
architecture.
- One of the advantages of DSLs is that they are less cryptic and
easier to learn for domain experts. Of course, the design of
such a language requires deep understanding of the problem
domain, on the other hand the existing tools for language
design are only mastered by a few experts.
3 DSL Examples
- There are easily 1000+ DSLs. But there is no known collection of
links. But, see
https://blog.xrds.acm.org/2013/12/on-domain-specific-language-usage/ 2013
- Generally believed: For the development of a large software, the
cost in designing and implementing a DSL for that software
development more than offsets the development costs.
- The design and implementation of DSL is a highly sought after
skill.
3.1 Well Known Examples
- HTML – web layout. Many other "markup" lanaguages. MarkDown,
PHP, …
- sed – non-interactive text editing.
man sed
in Linux.
- gawk – manipulate lines of text.
man gawk
in Linux.
- dot – define graphs, with nodes and directed/ undirected edges.
- PlantUML – A DSL to draw UML diagrams. http://plantuml.com/
- SQL – database query language.
- build.gradle – software build scripting
4 Tools for the DSLs
- Several tools exist now (2018). E.g., MPS: Domain-Specific Language
Creator by JetBrains.
- The tools assume good command over Grammars and ASTs.
- See the book by Voelter et al. (see Refs).
5 References
- Javier Luis Canovas Izquierdo, Domain-specific Languages,
javier.canovas@inria.fr, ./dsl-jlcanovas-slides-156.pptx 156
slides. 2013. Required Reading.
- http://martinfowler.com/books/dsl.html Domain Specific Languages,
Language workbenches. 2010. DSLs: An Introductory Example, first
chapter of the book. Highly Recommended Reading.
- Mernik, Marjan, Jan Heering, and Anthony M. Sloane. "When and how
to develop Domain-Specific Languages", ACM Computing Surveys,
vol. 37, no. 4, 2005, pp 316-344. Recommended Reading.
- Markus Voelter et al., DSL Engineering: Designing, Implementing and
Using Domain-Specific Languages, 2013, http://dslbook.org/
"Donationware". Pretty good. Recommended Reading.
- Shaikhha, Amir, Vojin Jovanovic, and Christoph Koch. "A
Compiler-Compiler for DSL Embedding." arXiv preprint
arXiv:1808.01344 (2018). Recommended Reading.