Abstract
Abstract A domain specific language (DSL) focuses on the essential concepts in a specific problem domain, and abstracts from low-level implementation details. The development of DSLs usually centers around the meta-model, grammar and code generator, possibly extended with transformations to analysis models. Typically, little attention is given to the formal semantics of the language, whereas this is essential for reasoning about DSL models, and for assessing the correctness of the generated code and analysis models. We argue that the semantics of a DSL should be defined explicitly and independently of any code generator, to avoid all kinds of complexities from low-level implementation details. As the generated analysis models must reflect some of these implementation details, we propose to formalize them separately. To assess the correctness and consistency of the generated code and analysis models in a practical way, we use conformance testing. We extensively illustrate this general approach using specific formalizations for an industrial DSL on collision prevention. We do not aim for a generic semantic model for any DSL, but this specific DSL indicates the potential of a modular semantics to facilitate reuse among DSLs.
Highlights
Well-known programming languages such as C++ and Java are general purpose languages (GPLs) that are universally applicable
The second question is about the correctness of each generated artifact: “Generating implementation code and analysis models is valuable, but how do we know that these artifacts are any good?” Checking the correctness of generated artifacts consists of two parts: whether they are syntactically correct, and whether they conform to the semantics of the domain specific language (DSL)
When performance analysis models are generated from DSL models, the generated models are only useful if they follow the relevant implementation details that were introduced by a specific code generator
Summary
Well-known programming languages such as C++ and Java are general purpose languages (GPLs) that are universally applicable. The language component is based on the essential concepts of a specific domain, and abstracts from low-level implementation details. The development of DSLs usually centers around defining the syntax of the language component (in terms of a meta-model or grammar depending on the tools being used) and a code generator, possibly extended with transformations to analysis models. Little attention is given to the formal semantics of the language, and to the implementation details introduced by a particular code generator that are relevant for some of the analysis models. Contribution In this article we focus on the significance of developing a formal semantics for a DSL and the impact of some low-level implementation details on the generated artifacts. We propose practical solutions for three questions: 1. What is the precise meaning of the language elements?
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.