Sound Language Composition under Product Extension: Enabling Rapid Development of Domain-Specific Language in the Miking Framework
2024 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Domain-Specific Languages (DSLs) are programming languages that facilitate the development of programs in a specific domain. Their primary advantages are increased expressiveness and usability. The disadvantage of DSLs is the fact that their development is costly. The Miking framework attempts to alleviate this downside by facilitating the rapid development of DSLs. The key insight of the Miking framework is that DSLs share many programming constructs. When developing compilers in the Miking framework, a programming language consists of many language fragments that each model a specific construct in the language. The Miking framework provides the notion of language composition that combines the aforementioned fragments into a single language which inherits functionality from all its components. Using these techniques, we do not have to create the entire compiler for a DSL from scratch, but can instead reuse existing language fragments. The current notion of language composition in the Miking framework centers around sum extension: The addition of new constructs to a language fragment. One issue during DSL development is that the composition of two fragments through sum extension does not necessarily result in a well-defined language. The reason for this is sum extension can potentially cause inexhaustive matches. To address this, the Miking framework has a notion of sound language composition in which a type system ensures that the resulting language is in fact well-defined. This thesis expands the work on language composition in the Miking framework by extending the notion of language composition with product extension: The addition of new information to existing constructs. Whereas language composition through sum extension is potentially unsound due to in-exhaustive matches, product extension introduces the possibility of illegal projections. This thesis recovers the soundness of language composition under product extension by extending the existing Miking type system with the notion of extensible product types.
Abstract [sv]
Domänspecifika språk (DSL) är programmeringsspråk som underlättar utvecklingen av program i en specifik domän. Deras främsta fördelar är ökad uttrycksförmåga och användbarhet. Nackdelen med DSL är det faktum att deras utveckling är kostsam. Miking-ramverket försöker lindra denna nackdel genom att underlätta den snabba utvecklingen av DSL. Den viktigaste insikten i Miking-ramverket är att DSL:er delar många programmeringskonstruktioner. När man utvecklar kompilatorer i Miking-ramverket består ett programmeringsspråk av många språkfrag- ment som varje modellerar en specifik konstruktion i språket. Miking- ramverket tillhandahåller begreppet språkkomposition som kombinerar de tidigare nämnda fragmenten till ett enda språk som ärver funktionalitet från alla dess komponenter. Med dessa tekniker behöver vi inte skapa hela kompilatorn för en DSL från början, utan kan istället återanvända befintliga språkfragment. Den nuvarande uppfattningen om språkkomposition i Miking- ramverket kretsar kring sum extension: tillägget av new konstruktioner till ett språkfragment. En fråga under DSL-utveckling är att samman- sättningen av två fragment genom summaförlängning inte nödvändigtvis resulterar i ett väldefinierat språk. Anledningen till detta är att summaförlängning potentiellt kan orsaka ofullständiga matchningar. För att ta itu med detta har Miking-ramverket en föreställning om ljudspråkskomposition där ett typsystem säkerställer att det resulterande språket faktiskt är väldefinierat. Den här avhandlingen utökar arbetet med språkkomposition i Miking- ramverket genom att utöka begreppet språkkomposition med product extension: The addition of new information to existing constructs. Där språksammansättning genom summaförlängning är potentiellt osunda på grund av uttömmande matchningar, introducerar produkttillägg möjligheten för olagliga projektioner. Denna avhandling återställer sundheten i språksammansättningen under produktutvidgning genom att utöka det befintliga systemet av Miking-typ med begreppet utvidgbara produkttyper.
Place, publisher, year, edition, pages
2024. , p. 152
Series
TRITA-EECS-EX ; 2024:915
Keywords [en]
Product Extension, Language Composition, Sound Language Composi- tion, Domain-Specific Language, Language Workbench, Miking, Type System, Record Polymorphism, Extensible Product Types
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-360883OAI: oai:DiVA.org:kth-360883DiVA, id: diva2:1942329
Supervisors
Examiners
2025-03-132025-03-042025-03-13Bibliographically approved