[Haskell-iPhone] ghc-iphone and TemplateHaskell

Stefan Kersten sk at k-hornz.de
Wed Jan 26 23:49:50 CET 2011


 On Wed, 26 Jan 2011 20:51:24 +0100, Stefan Kersten wrote:
> On Thu, 27 Jan 2011 08:21:43 +1300, Stephen Blackheath [to 
> GHC-iPhone] wrote:
>> If you build the stage 2 compiler using the stage 1 compiler, then 
>> the
>> stage 2 compiler will only be able to run on the iPhone!
>>
>> What you need to do is change the options used in building the stage 
>> 1
>> compiler.
>
> ah, of course, good point. i'll see how far i get figuring out the
> options ...

 and this excerpt from [1] indicates that TH is not possible in a 
 stage-1 cross compiler:

 "If you are building GHC from source, you need at least a stage-2 
 bootstrap compiler to run Template Haskell. A stage-1 compiler will 
 reject the TH constructs. Reason: TH compiles and runs a program, and 
 then looks at the result. So it's important that the program it compiles 
 produces results whose representations are identical to those of the 
 compiler itself."

 hmm ...

 <sk>

 [1] 
 http://www.haskell.org/ghc/docs/7.0.1/html/users_guide/template-haskell.html




More information about the iPhone mailing list