You may be interested in using C-DSL to generate your DSL’s output. It should keep your output readable.

https://bitbucket.org/jozefg/c-dsl

Kyle Marek-Spartz
 
 
 
 
 
On Sep 18, 2014, 8:18:10 AM, Dr Christopher Anand <anandc@mcmaster.ca> wrote:
Hi Felipe,

We performed an (unplanned) experiment relevant to your case.  We developed a DSL in Haskell and a library of math functions while IBM was doing the same thing in C.


The C library was 4X slower, and less accurate.

More recently we have wrapped-up a prototype for type-safe physical models and there is a preprint and three example implementations which might be of help in constructing your own. 


Good luck explaining why Haskell is so good for DSLs.  You might find


helpful.

Christopher