Embrace, defend, extend: a methodology for embedding preexisting DSLs

Domain-specific languages offer programming abstractions that enable higher efficiency, productivity and portability specific to a given application domain. Domain-specific languages such as StreamIt have valuable auto-parallelizing code-generators, but they require learning a new language and tool-chain and may not integrate easily with a larger application. One solution is to transform such standalone DSLs into embedded languages within a general-purpose host language. This prospect comes with its own challenges, namely the compile-time and runtime integration of the two languages. In this paper, we address these challenges, presenting our solutions in the context of a prototype embedding of StreamIt in Haskell. By demonstrating this methodology, we hope to encourage more reuse of DSL technology, and fewer short-lived reimplementations of existing techniques.

[1]  Simon L. Peyton Jones,et al.  Template meta-programming for Haskell , 2002, Haskell '02.

[2]  Simon L. Peyton Jones,et al.  Runtime support for multicore Haskell , 2009, ICFP.

[3]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[4]  Koen Claessen,et al.  Observable Sharing for Functional Circuit Description , 1999, ASIAN.

[5]  Torsten Hoefler,et al.  Kanor - A Declarative Language for Explicit Communication , 2011, PADL.

[6]  Jens Palsberg,et al.  Concurrent Collections , 2010 .

[7]  Rishiyur S. Nikhil,et al.  Bluespec System Verilog: efficient, correct RTL from high level specifications , 2004, Proceedings. Second ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2004. MEMOCODE '04..

[8]  William Thies,et al.  StreamIt: A Language for Streaming Applications , 2002, CC.

[9]  Simon L. Peyton Jones,et al.  A monad for deterministic parallelism , 2012, Haskell '11.

[10]  David Tarditi,et al.  Accelerator: using data parallelism to program GPUs for general-purpose uses , 2006, ASPLOS XII.

[11]  Bo Joel Svensson,et al.  Expressive array constructs in an embedded GPU kernel programming language , 2012, DAMP '12.

[12]  Sivan Toledo,et al.  Wishbone: Profile-based Partitioning for Sensornet Applications , 2009, NSDI.

[13]  Manuel M. T. Chakravarty,et al.  Accelerating Haskell array codes with multicore GPUs , 2011, DAMP '11.

[14]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[15]  Trevor L. McDonell Optimising purely functional GPU programs , 2013, ICFP.

[16]  Simon L. Peyton Jones,et al.  Regular, shape-polymorphic, parallel arrays in Haskell , 2010, ICFP '10.

[17]  M. Welsh,et al.  The Regiment Macroprogramming System , 2007, 2007 6th International Symposium on Information Processing in Sensor Networks.

[18]  Ryan Newton,et al.  Design and evaluation of a compiler for embedded stream programs , 2008, LCTES '08.

[19]  Simon Peyton Jones,et al.  Safe haskell , 2013 .

[20]  Michael D. McCool,et al.  Intel's Array Building Blocks: A retargetable, dynamic compiler and embedded language , 2011, International Symposium on Code Generation and Optimization (CGO 2011).

[21]  Kurt Keutzer,et al.  Copperhead: compiling an embedded data parallel language , 2011, PPoPP '11.

[22]  Roman Leshchinskiy,et al.  Stream fusion: from lists to streams to nothing at all , 2007, ICFP '07.

[23]  J. Gregory Morrisett,et al.  Nikola: embedding compiled GPU functions in Haskell , 2010, Haskell '10.

[24]  Bradley C. Kuszmaul,et al.  The pochoir stencil compiler , 2011, SPAA '11.