particular problem domain Notations that domain experts know Constructs and abstractions that may not be GPL-compatible Analysis, verification, optimisation, transformation can rely on domain knowledge Not necessarily executable <html > <head > <title >SAWDAP Workshop Program </title > </head > <body > ... </body > </html > 3 / 16
Compiler Target Program Target Program Problem Input Problem Output Internal/Embedded DSL (Shallow) Host Program Host Compiler Target Program DSL Program Host Library DSL Library 6 / 16
primitives and generic collections operations are generic mapping, reducing, etc over collections solutions to many problems from many concrete domains can be expressed in this way solutions are abstract compared to the problem domain Concrete DSLs based on data types found in the domain operations are custom for the domain targeted at a particular concrete domain solutions are highly specific to the domain 10 / 16
specification class GCD extends Module { val io = new Bundle { val a = UInt(INPUT , 16) val b = UInt(INPUT , 16) val e = Bool(INPUT) val z = UInt(OUTPUT , 16) val v = Bool(OUTPUT) } val x = Reg(UInt ()) val y = Reg(UInt ()) when (x > y) { x := x - y } unless (x > y) { y := y - x } when (io.e) { x := io.a; y := io.b } io.z := x io.v := y === UInt (0) } Berkeley, chisel.eecs.berkeley.edu 11 / 16
computation to a particular mesh structure, including analysis for parallelisation. for (edge <- edges (mesh)) { val flux = flux_calc (edge) val v0 = head (edge) val v1 = tail (edge) Flux (v0) += flux Flux (v1) -= flux } Supports complex partial differentiation equation systems over these mesh structures. 13 / 16
with shallow embedding while language is designed Move to deep embedding to add analysis, optimisation, code generation Domain experts know the problem domain Identify the key concepts, data and operations for their problems Together Rapidly prototype embedded languages for new domains Develop optimised implementations as applications grow 15 / 16
board game: Christian Hammond on Flickr MapReduce flow diagram: Lukas Kaestner on Flickr Delite figures from Delite: A Compiler Architecture for Performance-Oriented Embedded Domain-Specific Languages by Sujeeth et al, ACM Transactions on Embedded Systems, 13(4), March 2014. 16 / 16