caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeffrey Scofield <dynasticon@mac.com>
To: caml-list@inria.fr
Subject: OCaml on iPhone (was: arm backend)
Date: Sat, 02 May 2009 16:15:00 -0700	[thread overview]
Message-ID: <m2ab5vt7uz.fsf_-_@mac.com> (raw)
In-Reply-To: <aee06c9e0905011707ybc280cey2735cec6416cee86@mail.gmail.com>

Nathaniel Gray <n8gray@gmail.com> writes:

> Ok, I'm glad I left this to people who are familiar with ARM
> assembly programming.  :-)

We've done a lot of assembly programming, but none of us is an
ARM expert.  We looked at ARM documents and the assembly (.s)
files generated by ocamlopt and gcc, and spent some long sessions
with gdb.

> Awesome, but now I'm confused because the arm.S you included
> has lots of .global pseudo-ops.  Do you not compile it with
> Apple's as?

At around line 36, you'll see:

  #define global globl

As I said in private mail, you could call this a hack, but it's a
way to avoid making lots of small changes everywhere in the file.

> What's your app?

We're working on a collection of card games for casual play.

> How are you managing the interface between Cocoa and OCaml?

This is a big topic.  The summary is that we model Cocoa objects
as OCaml objects.  We have a layer that wraps OCaml objects in
smallish ObjC objects for use on the ObjC side, and wraps ObjC
objects in smallish OCaml objects for use on the OCaml side.  The
layer then translates between these representations as required
for calls into iPhoneOS and Cocoa Touch from OCaml (asking for
iPhone OS services) and into OCaml from iPhoneOS (for event
handling).

> > We also made a small fix to the ARM code generator
>
> I am very interested in any and all information needed to get a
> correct OCaml port suitable for use in App Store applications.
> Please share!

OK, I'll gather up our patch and send it to the list.  I want to
separate out our changes from those of Toshiyuki Maeda [1].

As I said, our patch fixes calls to external C float functions
such as floor(), sin(), and so on.  There is special handling in
ocamlopt to allow them to be unboxed, but the ABI of the existing
ARM code generator doesn't match the iPhone ABI.

Regards,

Jeff Scofield
Seattle

[1] http://web.yl.is.s.u-tokyo.ac.jp/~tosh/ocaml-on-iphone/


  reply	other threads:[~2009-05-02 23:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30 12:14 arm backend Joel Reymont
2009-04-30 13:28 ` Sylvain Le Gall
2009-04-30 18:03   ` [Caml-list] " Stéphane Glondu
2009-04-30 19:19     ` Nathaniel Gray
2009-05-01 12:02       ` Mattias Engdegård
2009-05-01 18:27         ` Nathaniel Gray
2009-05-01 19:24           ` Mattias Engdegård
2009-05-01 22:12       ` Jeffrey Scofield
2009-05-02  0:07         ` [Caml-list] " Nathaniel Gray
2009-05-02 23:15           ` Jeffrey Scofield [this message]
2009-05-03 12:34             ` [Caml-list] OCaml on iPhone (was: arm backend) Robert Muller
2009-05-05  4:59               ` OCaml on iPhone Jeffrey Scofield
2009-05-05  9:43 ` [Caml-list] arm backend Xavier Leroy
2009-05-05 18:21   ` Nathaniel Gray
2009-05-06  3:56   ` Jeffrey Scofield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ab5vt7uz.fsf_-_@mac.com \
    --to=dynasticon@mac.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).