Sunday, August 8, 2010

Applications on a mobile device

In my effort to study the ontology of space, time and persons in my life and how to organize it in a better Personal Information Manager, I want to build a system I can use to test the ontology to gradually improve it. I believe that only ontologies which are actually used can teach us anything about ontology design.

Therefore, I need a method to build applications on the mobile design in a high level language such that I can derive the code from a formally described ontology, preferably Haskell, which reveals structure of the program and does not force programming in particular ways. Simply: I need a Haskell compiler producing code executable on the mobile, because only if it is executing on the mobile and the data are synced, the application is available even if not connected to the Internet.

There are project to compile Haskell to JavaScript, which can be executed in most browsers on the mobile and small server programs running in a mobile exists. Unfortunately, neither of the JavaScript project is currently usable. They are often based on the York Haskell Compiler (yhc), which seems abandoned. Other projects are 'proof of concept' and to make them usable is beyond what I am prepared to do. It will take some time, before I can compile Haskell and run it on the mobile.

Second best:

Use another language, e.g. JavaScript, lua or python which execute on an Android mobile. I fear this will detract from identify the ontology, ontological issues obfuscated by the particulars of the language. I briefly looked at OCaml, a functional language close to Haskell, but the code read as text was quite misleading ("ignore" all over the place - my brain follows the advice and ignores the rest of the line...).

Restrict the application development to make it usable only when connected to the Internet; then I can write in Haskell and hopefully drive the code from the ontology - as much as possible from a formal description of the ontology deriving the code automatically. Later, the code can be hand-translated to a language executable on the mobile (today, I would probably use Lua) and run there.


  1. Have you thought about a two-step compilation process? I think there are compilers that produce Java from Haskell code, which could then eventually be used in Google Web Toolkit to produce JS.

    Just an idea, no clue whether it actually works…

  2. I did search for Haskell to Java but could not find anything. There are only a number of references to Haskell to Javascript, which is a very different language from Java, despite the name. I found a discussion of the feasability of translation from Haskell to Java Virtual Machine JVM, or Davlik code, but not a working program; the assessment was that it would be difficult to produce something with good performance.
    If you have something specific, I am interested!

  3. I just found LambdaVM (, but then I saw that it produces Java bytecode, so that does not really help. I thought I had read about a working Haskell-to-Java compiler somewhere, but apparently I was wrong…