Metasepi team meeting #8':
Haskell apps on Android NDK
Who am I?
☆ Twitter: @master_q
☆ Organizer of Metasepi Project
☆ A developer of Ajhc Haskell compiler
☆ A Debian Maintainer
☆ 10 years' experience in developing
OS using NetBSD.
☆  Demo
☆  What is Ajhc?
☆  What is Metasepi?
☆  What is compiler to build OS
☆  How to use Ajhc
☆  Haskell on Android NDK
☆  Status report of framework
☆ A touchable cube demo.
☆ Haskell App runs on Android NDK.
☆ GC is breaked by ndk-gdb debugger.
☆ The App is available at Google Play.
☆ You can watch the movie following.
 What is Ajhc?
☆ Ajhc := A fork of jhc
☆ jhc := John's Haskell Compiler
☆ Jhc outputs binary that has lowmemory-footprint and runs fast.
☆ Good for embedded software.
Who is John?
☆ John Meacham
Why need Ajhc?
☆ GHC is de facto standard on Haskell.
☆ GHC := Glasgow Haskell Compiler
☆ Why need another Haskell compiler?
☆ To develop kernel named "Metasepi".
 What is Metasepi?
☆ Unix-like OS designed by strong type.
☆ Using ML or more strong type lang.
. . . and suchlike.
Why need Metasepi?
☆ We have already Linux or Windows.
☆ But the developers are suffering.
☆ If use the kernel changed by you,
☆ you will get many runtime error.
☆ Difficult even to reproduce it.
Doesn't OSS have good quality?
☆ "The Cathedral and the Bazaar"
☆ "Given enough eyeballs, all bugs are
☆ But if you develop your own product
☆ Less runtime errors.
Kernel wants type desperately
☆ Kernels are developed with C lang.
☆ Error on user space => SEGV
☆ Error on kernel space => Halt!
☆ Should design kernel with the
☆ C language is safe?
 What is compiler to build OS
☆ Need strong type.
☆ Need flexibility such as C language.
☆ Create it if there are not!
☆ From scratch? No thank you...
☆ Look for our compiler base.
Want POSIX free compiler
Programs to print "hoge" on terminal.
The lesser depends on POSIX, the
Jhc output has only 20 undef
$ nm hs.out | grep
Survive burning out
Let's develop with dogfooding style.
(The method is called "Snatch".)
 How to use Ajhc
Case of Ubuntu 12.04 amd64.
$ sudo apt-get install haskell-platform libncurses5-dev gcc m4
$ cabal update
$ export PATH=$HOME/.cabal/bin/:$PATH
$ cabal install ajhc
$ which ajhc
$ echo 'main = print "hoge"' > Hoge.hs
$ ajhc Hoge.hs
You can use on Windows or Mac OS X.
Detail of usage
☆ Please read "Ajhc User's Manual".
☆ Also you can read in Japanese.
 Haskell on Android NDK
☆ First, build the demo apps.
☆ Then, see more detail of the code.
PR: Call For Articles
☆ Fanzine of functional programming.
☆ About Haskell or OCaml or . . .
☆ Article about Ajhc in C84 book.
☆ Call me if you read it!