[Haskell-iPhone] ghc-iphone and TemplateHaskell

Stephen Blackheath [to GHC-iPhone] likeliest.complexions.stephen at blacksapphire.com
Thu Jan 27 00:09:10 CET 2011


Stefan,

It could be that it won't work.  If it compiles to core then interprets
the core (like ghci does), then it would work, but it would have to get
dependent libraries from somewhere, and the iPhone ones won't run.
Perhaps it can be done by using the simulator compiler.  Those programs
actually will run natively, and at least it is possible for the
dependent libraries to be close enough to being the same that it should
work.


Steve

On 27/01/11 11:49, Stefan Kersten wrote:
> 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
> 
> 
> 
> _______________________________________________
> iPhone mailing list
> iPhone at haskell.org
> http://www.haskell.org/mailman/listinfo/iphone
> 



More information about the iPhone mailing list