[GHC] #10382: Template Haskell (non-quasi) quotes should work with stage 1 compiler

GHC ghc-devs at haskell.org
Sat May 9 02:12:24 UTC 2015


#10382: Template Haskell (non-quasi) quotes should work with stage 1 compiler
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:  ezyang
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Template Haskell  |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D876
-------------------------------------+-------------------------------------

Comment (by angerman):

 Sorry for being a little late to the discussion. Ideally, I would prefer
 that a stage1 compiler would try and go ahead with compiling template
 haskell, until it figures it can't.  Motivation being: when ever I find
 time to hack on out-of-process-template-haskell (effectively trying to
 bring over luites th approach from ghcjs), I have to inject lots of ifdefs
 into the ghc code to even get ghc to the point where it starts to complain
 that it can't compile the splice instead of refusing to even try it right
 from the start.

 I haven't had much time to work on it throughout the last half year but
 would love to continue with it. I'll leave some of the relevant links
 here:
 - https://mail.haskell.org/pipermail/ghc-devs/2014-December/007555.html
 - https://ghc.haskell.org/trac/ghc/wiki/TemplateHaskell/CrossCompilation

 From my understanding, and please correct me if I'm wrong, th splices fall
 into three categories:
 - (a) IO - can be anything includiing arbitarary IO actions at compile
 time.
 - (b) Target dependent - reading target intrinsic values (maxBound :: Int)
 - (c) everything else that does not include (a) or (b).

 where (c) should be fine to compile on the host, (b) could probably be
 also compiled on the host if all the target intrinsic information is taken
 care of. (a) is going to be interesting, as at least with the out-of-
 process-th appraoch, you would be running the code on a device that might
 not have the same environment. Such that thinks like looking up git
 revisions would have to fail.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10382#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list