• Refine Query
  • Source
  • Publication year
  • to
  • Language
  • 1
  • Tagged with
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • About
  • The Global ETD Search service is a free service for researchers to find electronic theses and dissertations. This service is provided by the Networked Digital Library of Theses and Dissertations.
    Our metadata is collected from universities around the world. If you manage a university/consortium/country archive and want to be added, details can be found on the NDLTD website.
1

Building Programming Languages, Construction by Construction / Att bygga programmeringsspråk, konstruktion för konstruktion

Palmkvist, Viktor January 2018 (has links)
The task of implementing a programming language is a task that entails a great deal of work. Yet much of this work is similar for different programming languages: most languages require, e.g., parsing, name resolution, type-checking, and optimization. When implementing domain-specific languages (DSLs) the reimplementation of these largely similar tasks seems especially redundant. A number of approaches exist to alleviate this issue, including embedded DSLs, macro-rewriting systems, and more general systems intended for language implementation. However, these tend to have at least one of the following limitations: They present a leaky abstraction, e.g., error messages do not refer to the DSL but rather some other programming language, namely the one used to implement the DSL. They limit the flexibility of the DSL, either to the constructs present in another language, or merely to the syntax of some other language. They see an entire language as the unit of composition. Complete languages are extended with other complete language extensions. Instead, this thesis introduces the concept of a syntax construction, which represents a smaller unit of composition. A syntax construction defines a single language feature, e.g., an if-statement, an anonymous function, or addition. Each syntax construction specifies its own syntax, binding semantics, and runtime semantics, independent of the rest of the language. The runtime semantics are defined using a translation into another target language, similarly to macros. These translations can then be checked to ensure that they preserve binding semantics and introduce no binding errors. This checking ensures that binding errors can be presented in terms of code the programmer wrote, rather than generated code in some underlying language. During evaluation several limitations are encountered. Removing or minimizing these limitations appears possible, but is left for future work / Att implementera ett programmeringsspråk är ett mycket arbetstungt åtagande. Detta trots att mycket av det som behöver göras inte skiljer sig särskilt mycket mellan olika språk, de flesta behöver exempelvis parsning, namnupplösning, typcheckning och optimering. För ett domänspecifikt programmeringsspråk (DSL) är denna upprepning ännu mer tydlig. Det finns ett antal olika metoder för att hantera detta, exempelvis embeddade DSLer, macro-system, och mer generella system för programspråksimplementation. Dessa tenderar dock att ha en eller flera av följande begränsningar: De abstraktioner som introduceras "läcker", felmeddelanden kan exempelvis referera till abstraktioner i ett annat programmeringsspråk, nämligen det som användes för att implementera DSLet. DSLet som implementeras blir begränsat, antingen till vad som finns i implementationsspråket, eller till implementationsspråkets syntax. Ett DSL ses som den minsta hela beståndsdelen i systemet. Om delar av språket ska återanvändas eller inkluderas i ett annat måste hela språket följa med. Denna avhandling introducerar istället syntaxkonstruktioner som minsta beståndsdel. En syntaxkonstruktion representerar en enskild del av ett språk, exempelvis en if-sats, en anonym funktion, eller addition. Varje syntaxkonstruktion definierar sin egen syntax, bindningssemantik och exekveringssemantik, utan referenser till språket som helhet. Exekveringssemantiken liknar en macro, den uttrycks som en översättning till ett implementationsspråk. Tack vare att bindningssemantiken är specifierad kan vi sedan kontrollera översättningen så att den inte kan introducera bindningsfel. Detta medför att felmeddelanden kan referera enbart till kod som programmeraren faktiskt skrev, istället för genererad kod i implementationsspråket. Evalueringen påvisar flera begränsningar med systemet. Begränsningarna tycks lösbara, men detta arbete lämnas till framtiden.

Page generated in 0.1578 seconds