Preprocessing eden with template haskell

Extending a programming language by new language constructs often implies extending its compiler by additional machinery. To reduce the complex interweaving of compiler and extension implementations we present a simple and modular concept of lifting the often needed additional preprocessing out of the base compiler implementation. Avoiding the introduction of standalone tools, this preprocessor framework for extensions of Haskell is designed as a separate portable library of monadic preprocessing functions based on Template Haskell. Additional preprocessing passes expressed in this framework can then much easier be carried along the series of ever advancing base compiler versions. Taking Eden, a parallel programming extension of Haskell, as an example we show that besides achieving improved portability and reusability pass code sizes can be reduced considerably.

[1]  Robert Glück,et al.  Generative Programming and Active Libraries , 1998, Generic Programming.

[2]  Dennis Gannon,et al.  Active Libraries: Rethinking the roles of compilers and libraries , 1998, ArXiv.

[3]  Hans-Wolfgang Loidl,et al.  Algorithm + strategy = parallelism , 1998, Journal of Functional Programming.

[4]  Mark P. Jones,et al.  Functional Programming with Overloading and Higher-Order Polymorphism , 1995, Advanced Functional Programming.

[5]  Simon Peyton Jones,et al.  Green card: a foreign-language interface for Haskell , 1997 .

[6]  Rita Loogen,et al.  Controlling parallelism and data distribution in Eden , 2000, Scottish Functional Programming Workshop.

[7]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[8]  Jost Berthold,et al.  Towards a Generalised Runtime Environment for Parallel Haskells , 2004, International Conference on Computational Science.

[9]  Stephen Gilmore,et al.  Evaluating the Performance of Skeleton-Based High Level Parallel Programs , 2004, International Conference on Computational Science.

[10]  Simon Peyton Jones,et al.  Playing by the rules: rewriting as a practical optimisation technique in GHC , 2001 .

[11]  Manuel M. T. Chakravarty,et al.  Optimising Embedded DSLs Using Template Haskell , 2004, GPCE.

[12]  Rita Loogen,et al.  Under Consideration for Publication in J. Functional Programming Parallel Functional Programming in Eden , 2022 .

[13]  Philip Wadler XQuery: A Typed Functional Language for Querying XML , 2002, Advanced Functional Programming.

[14]  Alexander A. Stepanov,et al.  Generic Programming , 1988, ISSAC.

[15]  Ralf Hinze,et al.  Haskell 98 — A Non−strict‚ Purely Functional Language , 1999 .

[16]  Roland Carl Backhouse,et al.  Generic Programming: An Introduction , 1998, Advanced Functional Programming.

[17]  Erik Hagersten,et al.  THROOM — Supporting POSIX Multithreaded Binaries on a Cluster , 2003 .

[18]  Ulf Norell,et al.  Prototyping Generic Programming in Template Haskell , 2004, MPC.

[19]  Rita Loogen,et al.  High-Level Process Control in Eden , 2003, Euro-Par.

[20]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

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

[22]  Ricardo Peña,et al.  Implementation of Functional Languages, 15th International Workshop, IFL 2003, Edinburgh, UK, September 8-11, 2003, Revised Papers , 2004, IFL.

[23]  Simon L. Peyton Jones,et al.  Scrap your boilerplate: a practical design pattern for generic programming , 2003, TLDI '03.