Dinkelaker, Tom (2011)
Reflective Embedding of Domain-Specific Languages.
Technische Universität Darmstadt
Ph.D. Thesis, Primary publication
|
Reflective Embedding of Domain-Specific Languages -
PDF
(Portable Document Format Datei)
dinkelaker-thesis-final.pdf Copyright Information: In Copyright. Download (2MB) | Preview |
Item Type: | Ph.D. Thesis | ||||||
---|---|---|---|---|---|---|---|
Type of entry: | Primary publication | ||||||
Title: | Reflective Embedding of Domain-Specific Languages | ||||||
Language: | English | ||||||
Referees: | Mezini, Prof. Dr.- Mira ; Hirschfeld, Prof. Dr.- Robert | ||||||
Date: | 29 November 2011 | ||||||
Place of Publication: | Darmstadt | ||||||
Publisher: | TU-Prints | ||||||
Collation: | 333 S. | ||||||
Date of oral examination: | 10 December 2010 | ||||||
Abstract: | In the recent years, there is an increasing interest for new programming languages that are special for certain problem domains – so-called domain-specific languages. A domain-specific language (DSL) provides a syntax and semantics for a particular class of problems. When writing code in a DSL, its concrete syntax enables higher end-user productivity because the syntax is closer to the problem domain than the syntax of a general-purpose language (GPL). However, implementing a new programming language is expensive, because language developers need to design and develop a new syntax and semantics. Because of these high initial costs, stakeholders desist from implementing a new DSL from scratch. To lower the initial costs of developing a DSL, there is the idea to embed a language into an existing language. The existing language—often a general-purpose language—acts as a host language for the guest language that is embedded into the host as a library. Such an embedded language reuses the general-purpose features of the host language. Consequently, this reduces the development costs of the embedded language by reusing these features and by reusing the existing host language infrastructure, i.e., its development tools, parser, compiler, and/or virtual machine. Furthermore, new language features can be incrementally added to the embedded language by “simply” extending its library. Indeed, there is a comparative study that shows that embedding requires significant lower investments to implement a new language compared to traditional non-embedded approaches. However, existing language embedding approaches have several important limitations w.r.t. the features that are usually supported by non-embedded approaches. First and foremost, most embedding approaches and host languages lack support for designing a concrete syntax for an embedded language. Second, current approaches do not allow embedding special language semantics that the embedded language needs but that conflict the host semantics. Third, there is no support for embedding multiple languages that have interactions in their syntax and semantics. The lack of support for these features in current embedding approaches mostly stem from their restrictions to adapt constructs in embedded languages and host languages. To address these limitations, this thesis proposes the reflective embedding architecture that embeds languages into reflective host languages. A reflective language is a special programming language with support for reflection that enables programs to reason about their structure and behavior. Specifically, there is support for introspection that allows analyzing programs, and support for intercession that allows transforming programs. Using reflection helps overcoming current limitations of language embedding, since it enables evolution of embedded languages by analyzing and transforming their libraries. The reflective embedding architecture itself defines a process how to embed a language’s syntax and semantics as a set of artifacts. Every language is an encapsulated component that has a set of well-defined interfaces. The classes of the embedding implement these interfaces to define the details of the execution semantics for that language component. In addition, the architecture enables embedding of language compositions, scoping strategies, domain-specific analyses and transformations. What is special in the architecture is that every language component implicitly has a meta level. When necessary, the language developers can use this meta level to evolve embeddings, which enables a number of benefits. First, in contrast to other embedded approaches, the reflective embedding architecture enables support for concrete syntax for embedded languages without high initial syntax costs. For an embedded language, developers can annotate its library with meta data for rewriting DSL programs in concrete syntax into a corresponding executable form. By using a special technique for agile grammar specification, called island grammars, developers only need to specify those parts of the embedded language’s grammar that deviate from the grammar of the host language. Island grammars help significantly reducing the initial syntax costs, while supporting the full class of context-free grammars. Second, the meta level enables support for composition of languages with interactions in their syntax and semantics. On the one hand, the architecture provides special language combiners that analyze and compose the syntax of all embedded languages in a composition. On the other hand, there are language combiners that transform embedded languages so that they can interact at well-defined points in their evaluation logic. By allowing interacting compositions, the architecture enables embedding special language abstractions that facilitate end user programmers to implement more modular programs. Third, the meta level enables embedding languages that interact with their host languages. The meta level uses reflective features to interact with the evaluation of host language constructs in order to change the host’s semantics. Only when the host semantics can be changed, developers can embed sophisticated DSLs. To review the reflective embedding architecture, this thesis conducts a qualitative and quantitative evaluation of the proposed concepts. First, to qualitatively evaluate the concepts of this thesis, the evaluation reviews the support of the reflective embedding architecture for supporting a set of desirable properties and compares its support to related work. Second, to quantitatively evaluate the concepts, the evaluation compares to embedded and non-embedded approaches using benchmarks. The results show that the architecture’s flexibility only comes with moderately increased runtime costs. |
||||||
Alternative Abstract: |
|
||||||
Uncontrolled Keywords: | Eingebettete Domänenspezifische Sprachen, Interne DSLs, Meta-Object Protokolle, Aspektorientierte Programmierung, Domänenspezifische Sprachen, Reflexive Programmierung, Meta-Level Architekturen, Sprachimplementierung | ||||||
Alternative keywords: |
|
||||||
URN: | urn:nbn:de:tuda-tuprints-28133 | ||||||
Classification DDC: | 000 Generalities, computers, information > 004 Computer science | ||||||
Divisions: | 20 Department of Computer Science 20 Department of Computer Science > Software Technology |
||||||
Date Deposited: | 06 Dec 2011 09:56 | ||||||
Last Modified: | 09 Jul 2020 00:00 | ||||||
URI: | https://tuprints.ulb.tu-darmstadt.de/id/eprint/2813 | ||||||
PPN: | 284768898 | ||||||
Export: |
View Item |