Bibliographic Details
| Title: |
A JavaScript Backend for the Miking Compiler |
| Authors: |
Rågstad, William |
| Publisher Information: |
KTH, Skolan för elektroteknik och datavetenskap (EECS) |
| Publication Year: |
2022 |
| Collection: |
Royal Inst. of Technology, Stockholm (KTH): Publication Database DiVA |
| Subject Terms: |
Bachelor’s Thesis, Miking, JavaScript, Compiler, Semantics, Code Generation, Optimization, Correctness, Soundness, and Readability, Kandidat Examensarbete, Kompilatorer, Semantik, Kodgenerering, Optimering, Korrekthet, Sundhet och Läsbarhet, Computer and Information Sciences, Data- och informationsvetenskap |
| Description: |
This thesis presents the design and implementation of an extension of the self-hosted Miking compiler to enable the generation of JavaScript code for different runtime environments and web browsers. Miking is a framework for developing domain-specific and general-purpose programming languages through sound language fragment composition, among other things, to create efficient compilers. Miking Core encapsulates a meta-language called Miking Lang and a fundamental functional Miking Expression language which Miking Lang itself is also lowered to. The presented backend translates Miking expressions into semantically equivalent effective, readable, sound, and correct JavaScript programs. In this report, development challenges, implementation methods, and techniques are also discussed and evaluated along with a review of the final compiler backend. Likewise, details on JavaScript-specific optimizations and pattern-matching compilation are presented, including how tail recursion is handled to enable complex Miking programs to be compiled into flexible and efficient JavaScript. ; Detta examensarbete presenterar design och implementation för utveckling av Miking-kompilatorn, med syfte att möjliggöra generering av JavaScript-kod för olika exekveringsmiljöer och webbläsare. Miking är ett ramverk för att utveckla domänspecifika och generella programmeringsspråk genom sund komposition av språksfragment som kan används för att skapa effektiva kompilatorer. Miking Core ramverket innehåller ett metaspråk kallat Miking Lang, vilket ”sänks” till det mer grundläggande funktionella Miking Expression-språket. ”Sänkning” betyder i huvudsak att skriva om mer komplexa semantiska konstruktioner i form av enklare. Den backend som presenteras översätter Miking-uttryck till semantiskt ekvivalenta JavaScript program som också är effektiva, läsbara, sunda och korrekta. I denna rapport diskuteras och utvärderas även utvecklingsutmaningar, implementeringsmetod och andra tekniker som har använts under arbetet. På samma sätt presenteras ... |
| Document Type: |
bachelor thesis |
| File Description: |
application/pdf |
| Language: |
English |
| Relation: |
TRITA-EECS-EX; 2022:883 |
| Availability: |
http://urn.kb.se/resolve?urn=urn:nbn:se:kth:diva-323147 |
| Rights: |
info:eu-repo/semantics/openAccess |
| Accession Number: |
edsbas.34665BA7 |
| Database: |
BASE |