[Haskell-cafe] iPhone/Android and Haskell [Was: Embedded funcional programming?]

Mathew de Detrich deteego at gmail.com
Sat Aug 7 21:08:30 EDT 2010

Well the other issue is of course that Android being available on a wide
variety of phones, not all of which run ARM (the phone I am about to get for
example has a custom built CPU), although I guess one could use a "generic"
ASM branch for "mobile" devices (if one exists). btw the phone I am about to
receive is a Samsung Galaxy-S, which has a hummingbird chip (no idea what
Assembler Instruction set it uses, I believe its a closed chip)

In my opinion the most "reliable" approach would actually to produce the C
that wraps around NDK (for any code that could be possible) which would
obviously interface with the Java libraries. Probably the biggest bane of
Android is the fact that its able to run on almost all machines means that
there *would* be issues using LLVM to just produce code for the generic ARM.

Using the NDK + Java would mean any app written in Haskell would work on any
android device. Of course as mentioned above, there are issues with this.
Its a lot of work for one thing, and the GC for Java is probably not the
best suited for Haskell structured programs. Also iirc, in order to make
"official" Android apps which can go on the market place, you are basically
forced to use the Java API + NDK for any native code, and you have to use
the Java API to interface with the android GUI/World (you can't make an
proper Android app just using NDK which complicates things further). The GC
issue I guess could be solved by generating JVM code (instead of Java
"code") which would give more freedom for GHC to generate code more suited
to Haskell

If this ever ended up happening, it does have the advantage that when one
would develop an app for Android using Haskell, GHC (or whatever compiler we
would use) can use NDK for as much code as possible and only resorting to
Java libraries when required which can of course equate to creating very
fast Android Apps using a productive language (Haskell)

As Don mentioned through, we need a java runtime for GHC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100807/5e6651bc/attachment.html

More information about the Haskell-Cafe mailing list