Domain-Specific Languages: Effective Modeling, Automation, and Reuse

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This textbook describes the theory and the pragmatics of using and engineering high-level software languages – also known as modeling or domain-specific languages (DSLs) – for creating quality software. This includes methods, design patterns, guidelines, and testing practices for defining the syntax and the semantics of languages. While remaining close to technology, the book covers multiple paradigms and solutions, avoiding a particular technological silo. It unifies the modeling, the object-oriented, and the functional-programming perspectives on DSLs. 
The book has 13 chapters. Chapters 1 and 2 introduce and motivate DSLs. Chapter 3 kicks off the DSL engineering lifecycle, describing how to systematically develop abstract syntax by analyzing a domain. Chapter 4 addresses the concrete syntax, including the systematic engineering of context-free grammars. Chapters 5 and 6 cover the static semantics – with basic constraints as a starting point and type systems for advanced DSLs. Chapters 7 (Transformation), 8 (Interpretation), and 9 (Generation) describe different paradigms for designing and implementing the dynamic semantics, while covering testing and other kinds of quality assurance. Chapter 10 is devoted to internal DSLs. Chapters 11 to 13 show the application of DSLs and engage with simpler alternatives to DSLs in a highly distinguished domain: software variability. These chapters introduce the underlying notions of software product lines and feature modeling.

The book has been developed based on courses on model-driven software engineering (MDSE) and DSLs held by the authors. It aims at senior undergraduate and junior graduate students in computer science or software engineering. Since it includes examples and lessons from industrial and open-source projects, as well as from industrial research, practitioners will also find it a useful reference. The numerous examples include code in Scala 3, ATL, Alloy, C#, F#, Groovy, Java, JavaScript, Kotlin, OCL, Python, QVT, Ruby, and Xtend.  The book contains as many as 277 exercises. The associated code repository facilitates learning and using the examples in a course.


Author(s): Andrzej Wąsowski, Thorsten Berger
Edition: 1
Publisher: Springer
Year: 2023

Language: English
Pages: 504
City: Cham
Tags: Model-Driven Software Engineering; Software Language Design; Domain Analysis; Conceptual Modeling; Design Patterns; Domain Specific Languages; Software Development Methods

Foreword
A Shiny New DSL Textbook in Town
Structure of the DSL Book
Original Qualities of the DSL Book
Reading Never Stops
Final Verdict
References
Preface
Contents
1 Using Modeling Languages
1.1 Model-Driven Software Engineering
1.2 Model-Driven Software Engineering in Industry
Further Reading
References
2 Building Modeling Languages
2.1 The Story of Abstraction in Programming Languages
2.2 The Ultimate Abstraction: Domain-Specific Languages
2.3 What Is a Language Built From?
2.4 Building a Language
2.5 Testing Language Implementations
Further Reading
Additional Exercises
References
3 Domain Analysis and Abstract Syntax
3.1 What is Meta-Modeling?
3.2 Domain Analysis for Meta-Modeling
3.3 Meta-Modeling with Class Diagrams
3.4 Guidelines for Meta-Modeling with Class Diagrams
3.5 Meta-Modeling with Algebraic Data Types
3.6 Language-Independent Meta-Modeling Guidelines
3.7 Case Study: Mind Maps
3.8 Quality Assurance and Testing for Meta-Models
3.9 The Language-Conformance Hierarchy
3.10 A Sneak Peek at XML
Further Reading
Additional Exercises
References
4 Concrete Syntax
4.1 Concrete and Abstract Syntax
4.2 Defining Concrete Syntax
4.3 How to Write a Grammar in Practice
4.4 Parsing and Tools
4.5 Guidelines for Specifying Concrete Syntax
4.6 Quality Assurance and Testing for Grammars
4.7 Grammars in the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
5 Static Semantics
5.1 Static Semantics with First-Order Structural Constraints
5.2 Writing Constraints in GPLs
5.3 Specialized Constraint Languages for Modeling
5.4 Guidelines for Writing Constraints
Constraints as a Modeling Paradigm
5.5 Quality Assurance and Testing for Static Constraints
5.6 Constraints in the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
6 Static Semantics with Type Systems
6.1 Abstract Syntax
6.2 The Language of Types
6.3 Type Hierarchy
6.4 Climbing the Type Hierarchy to Merge Compatible Types
6.5 A Type-Checking Algorithm for Expressions
6.6 Type Checking for Models
6.7 Quality Assurance and Testing Type Checkers
6.8 Types in the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
7 Model and Program Transformation
7.1 Technological Spaces
7.2 Model-Transformation Case Studies
7.3 Applications of Model and Program Transformation
7.4 Transformation Fundamentals
7.5 Program-Transformation Case Studies
7.6 Transformation Technologies
7.7 Guidelines for Writing Transformations
7.8 Quality Assurance
7.9 A Critical Discussion
Further Reading
Additional Exercises
References
8 Interpretation
8.1 Domain Implementation
8.2 The Interpreter Proper
8.3 Case Study: The Robot Language Interpreter
8.4 Monitoring and Models-At-Runtime
8.5 Guidelines for Implementing DSL Interpreters
8.6 Quality Assurance and Testing for Interpreters
8.7 Interpreters in the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
9 Code Generation
9.1 Reference Example Implementation
9.2 Code Generation Using Visitors and Recursion
9.3 Memory Management for Code Generation
9.4 Code Generation with Templates
9.5 Case Study: Robot
9.6 Guidelines for Implementing DSL Code Generators
9.7 Quality Assurance and Testing for Code Generators
9.8 Code Generation in the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
10 Internal Domain-Specific Languages
10.1 Internal DSLs with the Deep Embedding Pattern
10.2 The Shallow Embedding Pattern
10.3 Examples of Internal DSLs
10.4 Guidelines and Techniques for Building Internal DSLs
10.5 Quality Assurance and Testing Internal DSLs
10.6 Internal DSLs and the Language-Conformance Hierarchy
Further Reading
Additional Exercises
References
11 Software Product Lines
11.1 Software Variants
11.2 Case Study: The Linux Kernel
11.3 Software Product Line Engineering
11.4 Variability Modeling
11.5 Case Study: A Fire Alarm System
11.6 Spectrum of Variability Modeling
Further Reading
References
12 Feature Modeling
12.1 The Notion of Feature
12.2 Documenting a Feature
12.3 Uses of Feature Modeling
12.4 A Feature-Modeling Process
Further Reading
References
13 Model and Language Variability
13.1 Case Study: Variability in our FSM DSL and its Models
13.2 Benefits of Variability in Models and DSLs
13.3 Variability Mechanisms for Models
13.4 Designing Language Product Lines
Further Reading
Additional Exercises
References