[Haskell-cafe] Re: Hugs on the iphone

Braden Shepherdson Braden.Shepherdson at gmail.com
Sun Sep 14 10:50:42 EDT 2008


Alberto R. Galdo wrote:
> Hi, is there any chance of having hugs  compile for the iPhone?
> 
> Cross-compiling? Compiling directly on the iPhone?
> 
> Greets,
> Alberto

The iPhone, like most modern mobile devices, is based on the ARM 
processor, for which there is currently no GHC port.

However, jhc outputs portable C code which can be (cross) compiled for 
ARM. I have succeeded in building Haskell code with jhc on my desktop 
(x86 Linux), then cross-compiling the resulting C code in a scratchbox 
environment for my Nokia N810.

In short, if you can compile C code for the iPhone (cross-compiled or 
native), you can probably use jhc to turn Haskell into suitable C.

jhc is not self-hosting, and it requires gcc as a back-end, so it isn't 
suitable for running on the device.

See also the GHC-on-ARM project[1], an attempt to port GHC to ARM Linux 
devices.


Braden Shepherdson
shepheb

[1] http://hackage.haskell.org/trac/ghc/wiki/ArmLinuxGhc



More information about the Haskell-Cafe mailing list