I'm not sure I correctly understand your approach, but to have the template
haskell reification work without any runtime communication with the
compiler you'd have to include the entire typechecker state, at least for
all names reachable from the splice (see
http://hackage.haskell.org/package/template-haskell-2.9.0.0/docs/Language-Haskell-TH-Syntax.html
, the Quasi class for the required functionality). This would mean
serializing all names with types modules, annotations, instances. I briefly
looked into this for GHCJS but decided that just querying the compiler
would be better.


On Sat, Jul 5, 2014 at 10:39 PM, John Meacham <j...@repetae.net> wrote:

> The target compiler would have the TH libraries, which could be made
> to be portable. The external program would just extract the TH bits
> and turn them into a program that spits the TH expanded output to a
> new file to compile, and repeat the process til no TH expansions exist
> and finally that is the result you pass to the compiler.
>
>      John
>
> On Sat, Jul 5, 2014 at 1:09 PM, Luite Stegeman <stege...@gmail.com> wrote:
> > How would you do reification with that approach?
> >
> >
> > On Sat, Jul 5, 2014 at 9:59 PM, John Meacham <j...@repetae.net> wrote:
> >>
> >> Actually, I was looking into it a little, and template haskell could
> >> effectively be implemented by a pre-processor and a portable library
> >> that is compiler independent. If one could get ghc to spit out the
> >> template haskell source after it expands it then that can be fed to
> >> jhc as a quick first pass, but ideally the pre-processor TH would
> >> create programs that can be run under the target compiler. that would
> >> bring TH to every haskell compiler.
> >>
> >>     John
> >>
> >> On Sat, Jul 5, 2014 at 10:38 AM, Brandon Allbery <allber...@gmail.com>
> >> wrote:
> >> > On Sat, Jul 5, 2014 at 1:34 PM, Carter Schonwald
> >> > <carter.schonw...@gmail.com> wrote:
> >> >>
> >> >> does JHC support template haskell?
> >> >
> >> >
> >> > Pretty sure TH is too closely tied to ghc.
> >> >
> >> > --
> >> > brandon s allbery kf8nh                               sine nomine
> >> > associates
> >> > allber...@gmail.com
> >> > ballb...@sinenomine.net
> >> > unix, openafs, kerberos, infrastructure, xmonad
> >> > http://sinenomine.net
> >>
> >>
> >>
> >> --
> >> John Meacham - http://notanumber.net/
> >> _______________________________________________
> >> Glasgow-haskell-users mailing list
> >> Glasgow-haskell-users@haskell.org
> >> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> >
> >
>
>
>
> --
> John Meacham - http://notanumber.net/
>
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to