<div dir="ltr">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 <a href="http://hackage.haskell.org/package/template-haskell-2.9.0.0/docs/Language-Haskell-TH-Syntax.html">http://hackage.haskell.org/package/template-haskell-2.9.0.0/docs/Language-Haskell-TH-Syntax.html</a> , 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.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 5, 2014 at 10:39 PM, John Meacham <span dir="ltr"><<a href="mailto:john@repetae.net" target="_blank">john@repetae.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The target compiler would have the TH libraries, which could be made<br>
to be portable. The external program would just extract the TH bits<br>
and turn them into a program that spits the TH expanded output to a<br>
new file to compile, and repeat the process til no TH expansions exist<br>
and finally that is the result you pass to the compiler.<br>
<span class="HOEnZb"><font color="#888888"><br>
     John<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Jul 5, 2014 at 1:09 PM, Luite Stegeman <<a href="mailto:stegeman@gmail.com">stegeman@gmail.com</a>> wrote:<br>
> How would you do reification with that approach?<br>
><br>
><br>
> On Sat, Jul 5, 2014 at 9:59 PM, John Meacham <<a href="mailto:john@repetae.net">john@repetae.net</a>> wrote:<br>
>><br>
>> Actually, I was looking into it a little, and template haskell could<br>
>> effectively be implemented by a pre-processor and a portable library<br>
>> that is compiler independent. If one could get ghc to spit out the<br>
>> template haskell source after it expands it then that can be fed to<br>
>> jhc as a quick first pass, but ideally the pre-processor TH would<br>
>> create programs that can be run under the target compiler. that would<br>
>> bring TH to every haskell compiler.<br>
>><br>
>>     John<br>
>><br>
>> On Sat, Jul 5, 2014 at 10:38 AM, Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>><br>
>> wrote:<br>
>> > On Sat, Jul 5, 2014 at 1:34 PM, Carter Schonwald<br>
>> > <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@gmail.com</a>> wrote:<br>
>> >><br>
>> >> does JHC support template haskell?<br>
>> ><br>
>> ><br>
>> > Pretty sure TH is too closely tied to ghc.<br>
>> ><br>
>> > --<br>
>> > brandon s allbery kf8nh                               sine nomine<br>
>> > associates<br>
>> > <a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a><br>
>> > <a href="mailto:ballbery@sinenomine.net">ballbery@sinenomine.net</a><br>
>> > unix, openafs, kerberos, infrastructure, xmonad<br>
>> > <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> John Meacham - <a href="http://notanumber.net/" target="_blank">http://notanumber.net/</a><br>
>> _______________________________________________<br>
>> Glasgow-haskell-users mailing list<br>
>> <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
>> <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
John Meacham - <a href="http://notanumber.net/" target="_blank">http://notanumber.net/</a><br>
</div></div></blockquote></div><br></div>