000218036 001__ 218036
000218036 005__ 20190509132554.0
000218036 0247_ $$2doi$$a10.5075/epfl-thesis-6882
000218036 02470 $$2urn$$aurn:nbn:ch:bel-epfl-thesis6882-6
000218036 02471 $$2nebis$$a10624521
000218036 037__ $$aTHESIS
000218036 041__ $$aeng
000218036 088__ $$a6882
000218036 245__ $$aUniting Language Embeddings for Fast and Friendly DSLs
000218036 269__ $$a2016
000218036 260__ $$bEPFL$$c2016$$aLausanne
000218036 300__ $$a148
000218036 336__ $$aTheses
000218036 502__ $$aProf. James Richard Larus (président) ; Prof. Martin Odersky (directeur de thèse) ; Prof. Christoph Koch, Prof. Walid Taha, Dr Sebastian Erdweg (rapporteurs)
000218036 520__ $$aThe holy grail for a domain-specific language (DSL) is to be friendly and fast. A DSL should be friendly in the sense that it is easy to use by DSL end-users, and easy to develop by DSL authors. DSLs can be developed as entirely new compilers and ecosystems, which requires tremendous effort and often requires DSL authors to reinvent the wheel. Or, DSLs can be developed as libraries embedded in an existing host language, which requires significantly less effort. Embedded DSLs (EDSLs) manifest a trade-off between being friendly and fast as they stand divided in two groups: - Deep EDSLs trade user experience of both DSL authors and DSL end-users, for improved program performance. As proposed by Elliott et al., deep EDSLs build an intermediate representation (IR) of a program that can be used to drive domain-specific optimizations, which can significantly improve performance. However, this program IR introduces significant usability hurdles for both the DSL authors and DSL end-users. Correctly transforming programs is difficult and error prone for DSL authors, while error messages can be cryptic and confusing for DSL end-users. - Shallow EDSLs trade program performance for good user experience. As proposed by P. Hudak, shallow EDSLs omit construction of the IR, i.e., they are executed directly in the host language. Although friendly to both DSL end-users and DSL authors, they can not perform domain-specific optimizations and thus exhibit inferior performance. This thesis makes a stride towards achieving both (1) good user experience for DSL authors and DSL end-users, as well as (2) enabling domain-specific optimizations for improved performance. It unites shallow and deep DSLs by defining an automatic translation from end-user-friendly shallow DSLs, to better-performing deep DSLs. The translation uses reflection of the host language to cherry-pick the best of both shallow and deep EDSLs. During program development, a DSL end-user is presented with user friendly features of a shallow EDSL. Before execution in a production environment, programs are reliably translated into the high-performance deep EDSL with equivalent semantics. Since maintaining both shallow and deep EDSLs is difficult, the thesis further shows how to reuse the shallow-to-deep translation to automatically generate deep EDSLs based on shallow EDSLs. With automatic generation of the deep EDSL, the DSL author is required only to develop a shallow EDSL and the domain-specific optimizations for the deep EDSL that she deems useful. Finally, the thesis discusses a new programming abstraction that eases the development, of a specific kind, of deep EDSLs that are compiled in two stages. The new abstraction simplifies management of dynamic compilation in two-stage deep EDSLs.
000218036 6531_ $$aEmbedded Domain-Specific Languages
000218036 6531_ $$aMacros
000218036 6531_ $$aDeep Embedding
000218036 6531_ $$aShallow Embedding
000218036 6531_ $$aCompile-Time Meta-Programming
000218036 6531_ $$aDynamic Compilation
000218036 700__ $$0243781$$g202774$$aJovanovic, Vojin
000218036 720_2 $$aOdersky, Martin$$edir.$$g126003$$0241835
000218036 8564_ $$uhttps://infoscience.epfl.ch/record/218036/files/EPFL_TH6882.pdf$$zn/a$$s6491062$$yn/a
000218036 909C0 $$xU10409$$0252187$$pLAMP
000218036 909CO $$pthesis-bn2018$$pDOI$$pIC$$ooai:infoscience.tind.io:218036$$qDOI2$$qGLOBAL_SET$$pthesis
000218036 917Z8 $$x108898
000218036 917Z8 $$x108898
000218036 917Z8 $$x108898
000218036 918__ $$dEDIC$$cIIF$$aIC
000218036 919__ $$aLAMP1
000218036 920__ $$b2016$$a2016-4-22
000218036 970__ $$a6882/THESES
000218036 973__ $$sPUBLISHED$$aEPFL
000218036 980__ $$aTHESIS