[Haskell-cafe] Haskell for Gingerbread

John Meacham john at repetae.net
Thu Jan 13 14:11:17 CET 2011


On Thu, Jan 13, 2011 at 3:07 AM, Stefan Kersten <sk at k-hornz.de> wrote:
> On 28.12.10 21:25, John Meacham wrote:
>> jhc generated C works on the android/ARM just fine. Android specific
>> libraries arn't available, so you would have to bind to what you want
>> with the FFI.
>
> is there a recommended procedure for porting code from GHC to JHC? i'd like to
> port an application of mine to ios/android, but my naive approach of specifying
> the jhc compiler in ~/.cabal/config fails with the first dependency (binary),
> because the base library does not have the required version. any hints?

In general cabal and jhc don't work together. However, many libraries
from hackage do "just work" when compiled with jhc manually so it
isn't as big of an issue in practice as one might think but the
porting isn't automated. If your code doesn't have any ghc specific
code in it then just calling jhc directly on Main and specifying the
packages you depend on with '-p' should do the right thing. If there
are specific libraries you need that arn't included in the jhc
distribution and should be, then ask on the jhc list and I'll see if I
can get them in the next release. A more automated way to do this
probably will appear at some point.

There were some issues found recently by the iPhone target that
probably apply to android too, see the following thread for how to
resolve them.

http://www.haskell.org/pipermail/jhc/2011-January/000858.html

     John



More information about the Haskell-Cafe mailing list