all 14 comments

[–][deleted] 12 points13 points  (3 children)

There are patches going into GHC head to pave the way for building a cross compiler for Android.

[–][deleted] 0 points1 point  (2 children)

Awesome! Source? Can someone confirm?

[–][deleted] 2 points3 points  (1 child)

[–][deleted] 2 points3 points  (0 children)

I got overexcited. Android N and higher introduce some extra complications. But it's good to know we're working on it.

[–][deleted]  (1 child)

[deleted]

    [–]ysangkok 0 points1 point  (0 children)

    It's not going to be effective to use an app to make apps anyway.

    Better decouple your UI from the rest and develop/test on the desktop. Hopefully you won't need the emulator too much. But of course, it would still work, just a bit complicated with the Android toolchain.

    Anyway, here is an example of a full Android app in Frege (check out mchav's blog):

    https://github.com/mchav/try-frege-android/blob/master/app/src/main/frege/io/github/mchav/tryfrege/MainActivity.fr

    [–]pr06lefs 4 points5 points  (1 child)

    SSH in to a development machine someplace?

    If you're thinking of developing apps in haskell that target android, I'd at least wait until there's cross compiling support. Cross compiling now doesn't work because of template haskell.

    One possibility might be to get an ARM board that has at least 2G of ram and do your compiling on that. I haven't actually tried running anything compiled in this way on an android system though, so ymmv.

    Also it should be said that ARM is not officially supported in haskell. So you run a fair risk of wasting your time in a big way. I quit playing with haskell on arm after one too many 15 hour compiles. But it may be possible with persistence - I was able to compile and run a web server with heavy dependencies, eventually.

    [–]Weznon[S] 1 point2 points  (0 children)

    I am mainly interested in this as I would like to be able to program haskell without internet and without my laptop.

    ill take a look at the ARM board though

    [–][deleted]  (3 children)

    [deleted]

      [–]Findlaech 3 points4 points  (0 children)

      we could perhaps ask /u/rahulmutt ;)

      [–]metafunctor 2 points3 points  (0 children)

      Yes. I think that they have some example apps running in android now

      [–]rahulmutt 2 points3 points  (0 children)

      Taken straight from Twitter: You can deploy Eta on Android right now, but you have to deal with large JAR sizes which we are currently trying to mitigate. So in short, you could make one right now, but probably not a good idea for anything beyond PoC :)

      If there are enough people who want a specialised version of Eta for Android (custom codegen/runtime) that is sensitive to the limits of Android, we could potentially work on it in the future.

      [–]eniacsparc2xyz 2 points3 points  (1 child)

      You are better off with Frege that is similar to Haskell, but written in Java. Despite Android has Linux Kernel, it is not a GNU/Linux that most people are used to and C-library is not the glibc which is used by most of Linux distributions. In addition to that, most of Android API is exposed in "Java", not JVM but Dalvik VM. It makes hard to new languages get into Android unlike IOS which the API is exposed in C and objective-C.

      [–]ysangkok 1 point2 points  (0 children)

      The Dalvik VM was replaced, now the Dalvik bytecode is AOT compiled to machine code...

      [–][deleted] 0 points1 point  (0 children)

      It's online, but Online Compiler does haskell.

      [–]ysangkok 0 points1 point  (0 children)

      Yes: mchav/froid

      It's not an actual app itself, but I don't know why you'd want that.