kth.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Simplifying Construction of Imperative DSLs within the Miking Framework: Implementing Imperative to Functional Transformations
KTH, School of Electrical Engineering and Computer Science (EECS).
KTH, School of Electrical Engineering and Computer Science (EECS).
2024 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
Förenkla Konstruktion av Imperativ DSL inom Miking Ramverk : Utföra Imperativ till Funktionell Transformationer (Swedish)
Abstract [en]

In the Miking framework, constructing an imperative language requires a DSL author to implement functional-style translations for each imperative-style feature themselves, such as early returns for instance. This leads to duplication of code and effort. The purpose of this thesis is to construct a DSL library with common imperative constructs that the authors can build on. The two major features are translation of while loops to recursive function calls, and splitting up the evaluation of imperative-style functions using return statements. We test our solution by evaluating against three different criteria: correctness, expressiveness, and performance. In terms of correctness, we determine that our solution works as intended. In terms of expressiveness, we determine that users are able to implement programs using features such as branching control flow and early returns from imperative languages such as C through our transformations. However, we find that we cannot support certain features, such as pointers. In terms of performance, we arrive at the conclusion that our solution is not as efficient as regular MExpr programs, but it does not significantly degrade performance and maintains the expected time complexity.

Abstract [sv]

För att skapa ett imperativt språk med Mikingramverket krävs det att DSL-skaparen själv implementerar översättningar från imperativa konstruktioner, exempelvis tidiga returanrop, till funktionella motsvarigheter. Detta leder till dubblering av kod och ansträngning. Syftet med denna avhandling är att skapa ett DSL-bibliotek med vanliga imperativa konstruktioner som DSL-skapare kan bygga vidare på. De två huvudsakliga funktionaliteterna är översättning av while-loopar till rekursiva funktionsanrop samt uppdelningen av imperativa funktioners utvärdering med returanrop. Vi testar vår lösning genom att utvärdera mot tre olika kriterier: korrekthet, uttrycksfullhet och prestanda. När det gäller korrekthet fastställer vi att vår lösning fungerar som avsett. När det uttrycksfullhet kan vi se att användare med hjälp av vårt bibliotek kan implementera program som använder funktionalitet, som förgrenat kontrollflöde och tidiga returanrop från imperativa språk som C. Dock finner vi funktionalitet som inte stödjs av vårt bibliotek, så som pekare. När det gäller prestanda drar vi slutsatsen att vår lösning inte är lika effektiv som vanliga MExpr-program, men den försämrar inte prestandan nämnvärt samt att den upprätthåller den förväntade tidskomplexiteten.

Place, publisher, year, edition, pages
Stockholm: KTH Royal Institute of Technology , 2024. , p. 51
Series
TRITA-EECS-EX ; 2024:622
National Category
Computer Sciences Computer Engineering
Identifiers
URN: urn:nbn:se:kth:diva-353733OAI: oai:DiVA.org:kth-353733DiVA, id: diva2:1900419
Educational program
Bachelor of Science in Engineering - Medical Technology
Supervisors
Examiners
Available from: 2024-10-02 Created: 2024-09-23 Last updated: 2024-10-02Bibliographically approved

Open Access in DiVA

fulltext(525 kB)100 downloads
File information
File name FULLTEXT01.pdfFile size 525 kBChecksum SHA-512
40cf82eb4e5a7b843e6d63650cac41dddb94af36192e033461545380c20acd5a831ff3143f5fdf8e347a3c72a3df934e7fb87083870acaa3b59d4760e4a99438
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer SciencesComputer Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 101 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 260 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf