File Download
Supplementary
-
Citations:
- Appears in Collections:
postgraduate thesis: Extensible domain-specific languages in object-oriented programming
Title | Extensible domain-specific languages in object-oriented programming |
---|---|
Authors | |
Issue Date | 2017 |
Publisher | The University of Hong Kong (Pokfulam, Hong Kong) |
Citation | Zhang, W. [张炜昕]. (2017). Extensible domain-specific languages in object-oriented programming. (Thesis). University of Hong Kong, Pokfulam, Hong Kong SAR. |
Abstract | Domain-specific languages (DSLs) are now ubiquitous. New DSLs are needed and existing DSLs are evolving all the time. However, creating and maintaining DSLs is hard! There is a lot of engineering effort involved in the creation and the maintenance of a DSL.
One way to address these difficulties is to have language components with high reusability and extensibility. Reusable components reduce the initial effort. Instead of developing everything from scratch, a new DSL is developed through reusing existing components. High extensibility reduces the effort of maintenance, making it easy to customize these components. DSLs, or programming languages in general, share a lot of features. Unfortunately, it is hard to materialize the conceptual reuse into software engineering reuse due to the lack of good modularization techniques. Syntactic modularization techniques based on meta-programming and code generation have been used for code reuse. However, more semantic aspects of modularity, such as the ability to do separate compilation and modular type-checking, are typically missing.
Programming languages have been investigated for seeking proper semantic modularization mechanisms. Object-oriented languages seem to be a good choice as they are designed for extensibility and reuse in the first place. The fundamental features of object-oriented programming (OOP), such as inheritance and subtyping, are vital for developing reusable and extensible components. Combining these features with some classic design patterns, namely the Visitor and Interpreter pattern, a certain degree of extensibility can be achieved. However, they are still insufficient to solve the so-called Expression Problem: one dimension of extensibility is traded by the other. New solutions to the Expression Problem have been proposed, making it possible to develop fully extensible components.
In this thesis we argue that object-oriented languages, equipped with powerful semantic modularization techniques, are suitable for developing extensible DSLs. In the first part of the thesis we develop EVF, an extensible and expressive Java Visitor frame- work, for facilitating external DSL development. To illustrate the applicability of EVF we conduct a case study, which refactors a large number of non-modular interpreters from the “Types and Programming Languages” book. The resulting interpreters are modular and reusable, sharing large portions of code and features. In the second part of the thesis, we show the close relationship between shallow embeddings and OOP and how OOP improves the modularity of internal DSLs. |
Degree | Master of Philosophy |
Subject | Domain-specific programming languages Object-oriented programming |
Dept/Program | Computer Science |
Persistent Identifier | http://hdl.handle.net/10722/241427 |
HKU Library Item ID | b5864204 |
DC Field | Value | Language |
---|---|---|
dc.contributor.author | Zhang, Weixin | - |
dc.contributor.author | 张炜昕 | - |
dc.date.accessioned | 2017-06-13T02:07:51Z | - |
dc.date.available | 2017-06-13T02:07:51Z | - |
dc.date.issued | 2017 | - |
dc.identifier.citation | Zhang, W. [张炜昕]. (2017). Extensible domain-specific languages in object-oriented programming. (Thesis). University of Hong Kong, Pokfulam, Hong Kong SAR. | - |
dc.identifier.uri | http://hdl.handle.net/10722/241427 | - |
dc.description.abstract | Domain-specific languages (DSLs) are now ubiquitous. New DSLs are needed and existing DSLs are evolving all the time. However, creating and maintaining DSLs is hard! There is a lot of engineering effort involved in the creation and the maintenance of a DSL. One way to address these difficulties is to have language components with high reusability and extensibility. Reusable components reduce the initial effort. Instead of developing everything from scratch, a new DSL is developed through reusing existing components. High extensibility reduces the effort of maintenance, making it easy to customize these components. DSLs, or programming languages in general, share a lot of features. Unfortunately, it is hard to materialize the conceptual reuse into software engineering reuse due to the lack of good modularization techniques. Syntactic modularization techniques based on meta-programming and code generation have been used for code reuse. However, more semantic aspects of modularity, such as the ability to do separate compilation and modular type-checking, are typically missing. Programming languages have been investigated for seeking proper semantic modularization mechanisms. Object-oriented languages seem to be a good choice as they are designed for extensibility and reuse in the first place. The fundamental features of object-oriented programming (OOP), such as inheritance and subtyping, are vital for developing reusable and extensible components. Combining these features with some classic design patterns, namely the Visitor and Interpreter pattern, a certain degree of extensibility can be achieved. However, they are still insufficient to solve the so-called Expression Problem: one dimension of extensibility is traded by the other. New solutions to the Expression Problem have been proposed, making it possible to develop fully extensible components. In this thesis we argue that object-oriented languages, equipped with powerful semantic modularization techniques, are suitable for developing extensible DSLs. In the first part of the thesis we develop EVF, an extensible and expressive Java Visitor frame- work, for facilitating external DSL development. To illustrate the applicability of EVF we conduct a case study, which refactors a large number of non-modular interpreters from the “Types and Programming Languages” book. The resulting interpreters are modular and reusable, sharing large portions of code and features. In the second part of the thesis, we show the close relationship between shallow embeddings and OOP and how OOP improves the modularity of internal DSLs. | - |
dc.language | eng | - |
dc.publisher | The University of Hong Kong (Pokfulam, Hong Kong) | - |
dc.relation.ispartof | HKU Theses Online (HKUTO) | - |
dc.rights | This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. | - |
dc.rights | The author retains all proprietary rights, (such as patent rights) and the right to use in future works. | - |
dc.subject.lcsh | Domain-specific programming languages | - |
dc.subject.lcsh | Object-oriented programming | - |
dc.title | Extensible domain-specific languages in object-oriented programming | - |
dc.type | PG_Thesis | - |
dc.identifier.hkul | b5864204 | - |
dc.description.thesisname | Master of Philosophy | - |
dc.description.thesislevel | Master | - |
dc.description.thesisdiscipline | Computer Science | - |
dc.description.nature | published_or_final_version | - |
dc.identifier.mmsid | 991026391769703414 | - |