[Haskell-cafe] Compiling a DSL on the shoulders of GHC

Patai Gergely patai_gergely at fastmail.fm
Mon Oct 18 09:36:57 EDT 2010


> There are many implementations of EDSLs which take the approach that you want
> to take by using Haskell to create a syntax tree and the offshore it to some
> backend compiler. None of them uses a timeout.
The difference is that they implement all the transformations after the
parsing phase, and there are no Haskell functions or arbitrary data
types in the syntax tree (unless we bring generics into the picture).

> But in case you really insist on a timeout I would recommend using a wrapper
> function on the toplevel of your metaprogram which implements the timeout.
> That way you don't have to risk your sanity by having to dig around in GHC.
Of course, as soon as I give everything an explicit representation, this
part of the story is straightforward.

Gergely

-- 
http://www.fastmail.fm - Accessible with your email software
                          or over the web



More information about the Haskell-Cafe mailing list