File Download
  Links for fulltext
     (May Require Subscription)
Supplementary

postgraduate thesis: Gems : language modularization, semantically

TitleGems : language modularization, semantically
Authors
Advisors
Issue Date2017
PublisherThe University of Hong Kong (Pokfulam, Hong Kong)
Citation
Li, H. [李璜]. (2017). Gems : language modularization, semantically. (Thesis). University of Hong Kong, Pokfulam, Hong Kong SAR.
AbstractGreat efforts are needed to create new programming languages, and to maintain and improve existing ones, since it requires both knowledge about language design and implementation, and knowledge about specific domains. Therefore, it is a desire to modularize languages as components and share common features among different languages, including syntax and semantics. Most current tools towards this goal, including many extensible compilers and language workbenches, depend on metaprogramming and code generation. They achieve only syntactic modularity by allowing users to write code separately. Semantic modularity, which requires the components to be modularly type-checked and separately compiled, is not fully available. A part of the language modularization issue is abstracted by the expression problem, which requires a recursive datatype (abstract syntax tree, AST) to be extended with both new operations (semantics) and new data variants (abstract syntax structures), while retaining semantic modularity. However, some solutions to the expression problem exist only on paper and practical tools and experiments are missing. Furthermore, the expression problem only focuses on operations that consume such extensible ASTs, while operations that produce ASTs are neglected, such as parsing, the bridge between concrete and abstract syntax. In the thesis, we present our work on modularizing the whole pipeline of languages. We build a Scala framework called Gems (Language Modularization, Semantically), which consists of two parts: a set of techniques to modularize languages, and a metaprogramming library for practical development. Semantic modularity is guaranteed in every aspect: parsing, abstract syntax, semantics (operations on ASTs). We use techniques of type-safe modular parsing, and modular external visitors with some enhancements. Gems only requires features that have strong theoretical background in object-oriented programming, including higher-order generics, type variance, and multiple inheritance. Scala-specific features such as case classes are not needed. Moreover, Gems does not rely on metaprogramming to achieve modularity, but only uses it to generate local boilerplate code. To evaluate its utility, we conduct a case study by implementing interpreters of the first 18 languages in book Types and Programming Languages, and compare with a non-modular implementation.
DegreeMaster of Philosophy
SubjectProgramming languages (Electronic computers)
Dept/ProgramComputer Science
Persistent Identifierhttp://hdl.handle.net/10722/255020

 

DC FieldValueLanguage
dc.contributor.advisorDos Santos Oliveira, BC-
dc.contributor.authorLi, Huang-
dc.contributor.author李璜-
dc.date.accessioned2018-06-21T03:41:57Z-
dc.date.available2018-06-21T03:41:57Z-
dc.date.issued2017-
dc.identifier.citationLi, H. [李璜]. (2017). Gems : language modularization, semantically. (Thesis). University of Hong Kong, Pokfulam, Hong Kong SAR.-
dc.identifier.urihttp://hdl.handle.net/10722/255020-
dc.description.abstractGreat efforts are needed to create new programming languages, and to maintain and improve existing ones, since it requires both knowledge about language design and implementation, and knowledge about specific domains. Therefore, it is a desire to modularize languages as components and share common features among different languages, including syntax and semantics. Most current tools towards this goal, including many extensible compilers and language workbenches, depend on metaprogramming and code generation. They achieve only syntactic modularity by allowing users to write code separately. Semantic modularity, which requires the components to be modularly type-checked and separately compiled, is not fully available. A part of the language modularization issue is abstracted by the expression problem, which requires a recursive datatype (abstract syntax tree, AST) to be extended with both new operations (semantics) and new data variants (abstract syntax structures), while retaining semantic modularity. However, some solutions to the expression problem exist only on paper and practical tools and experiments are missing. Furthermore, the expression problem only focuses on operations that consume such extensible ASTs, while operations that produce ASTs are neglected, such as parsing, the bridge between concrete and abstract syntax. In the thesis, we present our work on modularizing the whole pipeline of languages. We build a Scala framework called Gems (Language Modularization, Semantically), which consists of two parts: a set of techniques to modularize languages, and a metaprogramming library for practical development. Semantic modularity is guaranteed in every aspect: parsing, abstract syntax, semantics (operations on ASTs). We use techniques of type-safe modular parsing, and modular external visitors with some enhancements. Gems only requires features that have strong theoretical background in object-oriented programming, including higher-order generics, type variance, and multiple inheritance. Scala-specific features such as case classes are not needed. Moreover, Gems does not rely on metaprogramming to achieve modularity, but only uses it to generate local boilerplate code. To evaluate its utility, we conduct a case study by implementing interpreters of the first 18 languages in book Types and Programming Languages, and compare with a non-modular implementation.-
dc.languageeng-
dc.publisherThe University of Hong Kong (Pokfulam, Hong Kong)-
dc.relation.ispartofHKU Theses Online (HKUTO)-
dc.rightsThe author retains all proprietary rights, (such as patent rights) and the right to use in future works.-
dc.rightsThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.-
dc.subject.lcshProgramming languages (Electronic computers)-
dc.titleGems : language modularization, semantically-
dc.typePG_Thesis-
dc.description.thesisnameMaster of Philosophy-
dc.description.thesislevelMaster-
dc.description.thesisdisciplineComputer Science-
dc.description.naturepublished_or_final_version-
dc.identifier.doi10.5353/th_991044014359703414-
dc.date.hkucongregation2018-
dc.identifier.mmsid991044014359703414-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats