Software Language Engineering
Software practitioners are rapidly discovering the immense value of Domain-Specific Languages (DSLs) in solving problems within clearly definable problem domains. Developers are applying DSLs to improve productivity and quality in a wide range of areas, such as finance, combat simulation, macro scripting, image generation, and more. But until now, there have been few practical resources that explain how DSLs work and how to construct them for optimal use. Software Language Engineering fills that need. Written by expert DSL consultant Anneke Kleppe, this is the first comprehensive guide to successful DSL design. Kleppe systematically introduces and explains every ingredient of an effective language specification, including its description of concepts, how those concepts are denoted, and what those concepts mean in relation to the problem domain. Kleppe carefully illuminates good design strategy, showing how to maximize the flexibility of the languages you create. She also demonstrates powerful techniques for creating new DSLs that cooperate well with general-purpose languages and leverage their power. Completely tool-independent, this book can serve as the primary resource for readers using Microsoft DSL tools, the Eclipse Modeling Framework, openArchitectureWare, or any other DSL toolset. It contains multiple examples, an illustrative running case study, and insights and background information drawn from Kleppe’s leading-edge work as a DSL researcher.

Review By: Peter Gabris
08/14/2009There is a lot Anneke Kleppe can tell you about software language engineering. She authored the Alan programming/modeling language, Octel transformation language, and wrapped her work on object constraints language (OCL) into the Octopus set of tool—just to mention a few of her achievements that are well appreciated by the advanced geek crowd. OCL has become the standard for specifying expressions in UML. Expressions allow incorporation of business rules, conditions, constrains, and queries into UML bringing static objects to life.
The Domain Specific Language (DSL) is an elusive term hinting a programming language so well suited for a given area that a domain expert can replace the programmer. Since domains are countless, once we learn how to formulate the DSL, we need a tool that would generate the DSL from the language metamodel. The Software Language Engineering: Creating Domain-Specific Languages Using Metamodels shows how that can be achieved.
In this book, Anneke Kleppe:
- Make the case for the software language engineering aiming a huge potential of DSLs
- Classifies roles in the language inception and use
- Defines and describes concepts and underlying theories
- Extends the scope of the software language by including graphical languages
- Describes, from a metamodel though the abstract syntax, the concrete syntax to the code that can recognize the textual or even graphical language utterance we used to call a program
- Show that languages can be created in a way that expressions in different languages can relate to each other
I warmly recommend this book to a reader who wants to learn how to define DSL in a metamodel and how to generate a compiler or interpreter from that definition. Even if you don't plan to go that far, the book is a great read if you want to know about this slowly but surely emerging great technology.
Review By: Tilmann Bruckhaus, Ph.D.
08/14/2009Anneke Kleppe's book provides a broad overview of domain-specific language engineering. Readers will find this book effective and helpful in creating a programming language or specification language. Such languages can apply to a particular problem domain, a particular problem representation technique, and/or a particular solution technique. For example, domain-specific languages include spreadsheet formulas and macros; YACC grammars for creating parsers; regular expressions for specifying lexers; the generic eclipse modeling system for creating diagramming languages; Csound, a language used to create audio files; and the input languages of GraphViz and GrGen, software packages used for graph layout and graph rewriting.
Kleppe's style is readable and lively, yet precise, rather than formal and dry. She provides numerous examples, diagrams, and drawings to illustrate the material. Software Language Engineering begins with an introduction that explores the purpose of software language engineering and a definition of the roles involved in language engineering, contrasting the language user to the language designer. Kleppe then defines languages, programs, and models. In her book, she coins the term "mogram" that combines models and programs. Based on this foundation, the reader learns about the formalisms that facilitate language engineering, such as context-free grammars, UML, graphs, instances, types, notations, meta models, platforms, and specifications. The following chapters cover abstract and concrete syntax and the specific domain-specific language Alan, which Kleppe utilizes to illustrate these concepts.
The remaining five chapters use these concepts to define and illustrate the process of domain-specific language engineering. This portion of the book begins with the process of generating textual concrete syntax, which involves abstract-to-concrete transformation, model-to-BNF transformation, and static semantic analysis. Kleppe devotes a chapter on the meaning—or semantics—of a language, specifically defining semantics, modeling semantics, and abstract state machines. Toward the end of Kleppe's book, the reader learns about the final step of applying domain-specific languages, the generation of code, which includes transformation rules, source and target-driven translation, code generation patterns, and extension points. Kleppe concludes with an advanced chapter on combining multiple languages.
Whenever it is possible to define a problem clearly, developers may consider the benefits of domain-specific languages that include increased productivity and expressiveness of programs and models. Kleppe provides a readable, useful, and comprehensive introduction into the concepts, technology, and tools available to the domain-specific language designer.