What is Ajhc?
Ajhc is a Haskell compiler, and acronym for the following:
Why need Ajhc?
Jhc converts Haskell code into pure C language code running with jhc's runtime. And the runtime is written with 3000 line (include comments) pure C code. It's a magic!
Ajhc's mission is to keep contribution to jhc in the repository. Because the upstream author of jhc, John Meacham, can't pull the contribution speedy. (I think he is too busy to do it.) We should feedback jhc any changes. And also Ajhc aims to provide Metasepi project with a method to rewrite NetBSD kernel using Haskell. The method is called Snatch-driven development.
Ajhc is, so to speak, an accelerator to develop jhc.
Demo: Haskell code running on Cortex-M3 board
The demo is running code that compiled with Ajhc on Cortex-M3 board, mbed. It's a simple RSS reader for reddit.com, show the RSS titles on Text LCD panel. You could read the demo detail and source code at https://github.com/ajhc/demo-cortex-m3.
Demo: Android NDK application written with Haskell
The touchable cube application is written with Haskell and compiled by Ajhc. The application is available at Google Play. In the demo, the application is breaked by ndk-gdb debugger when running GC. You could read the demo source code at https://github.com/ajhc/demo-android-ndk. Also read slide about the detail at http://www.slideshare.net/master_q/20131020-osc-tokyoajhc.
How to install Ajhc
Easy to install Ajhc with Cabal.
$ cabal install ajhc $ ajhc --version ajhc 0.8.0.1 (80aa12fb9b57622bba2f0e911d7ebc0c04ddb662) compiled by ghc-7.4 on a x86_64 running linux $ echo 'main = print "hoge"' > Hoge.hs $ ajhc Hoge.hs $ ./hs.out "hoge"