Creating domain-specific languages by composing syntactical constructs
Autor: | David Broman, Viktor Palmkvist |
---|---|
Jazyk: | angličtina |
Rok vydání: | 2019 |
Předmět: |
Statement (computer science)
050101 languages & linguistics Domain-specific language Semantics (computer science) Computer science Programming language media_common.quotation_subject 05 social sciences Name resolution (programming languages) 02 engineering and technology Ambiguity Construct (python library) computer.software_genre Language Technology (Computational Linguistics) Anonymous function Feature (linguistics) 0202 electrical engineering electronic engineering information engineering 020201 artificial intelligence & image processing 0501 psychology and cognitive sciences computer Språkteknologi (språkvetenskaplig databehandling) media_common |
Zdroj: | Practical Aspects of Declarative Languages ISBN: 9783030059972 PADL |
Popis: | Creating a programming language is a considerable undertaking, even for relatively small domain-specific languages (DSLs). Most approaches to ease this task either limit the flexibility of the DSL or consider entire languages as the unit of composition. This paper presents a new approach using syntactical constructs (also called syncons) for defining DSLs in much smaller units of composition while retaining flexibility. A syntactical construct defines a single language feature, such as an if statement or an anonymous function. Each syntactical construct is fully self-contained: it specifies its own concrete syntax, binding semantics, and runtime semantics, independently of the rest of the language. The runtime semantics are specified as a translation to a user defined target language, while the binding semantics allow name resolution before expansion. Additionally, we present a novel approach for dealing with syntactical ambiguity that arises when combining languages, even if the languages are individually unambiguous. The work is implemented and evaluated in a case study, where small subsets of OCaml and Lua have been defined and composed using syntactical constructs. QC 20190121 |
Databáze: | OpenAIRE |
Externí odkaz: |