mentby.com
Blog | Jobs | Help | Signup | Login

loading
Greetings OCamlers,

I just released a version of OCaml 4.00.0 that creates apps that run in
the iOS Simulator.  I call it OCamlXSim for short.

You can download a binary release, or get instructions for bulding from
sources:

     http://psellos.com/ocaml/compile-to-iossim.html

After you've gotten your app working in the simulator, you can compile
it for iOS and release it in the iOS App Store:

     http://psellos.com/ocaml/compile-to-iphone.html

I also have a page of OCaml-on-iOS resources:

    http://psellos.com/ocaml/

It's quite a bit easier to make OCaml work for the iOS Simulator than
for iOS because the i386 code generator works with no changes.  The main
trick is convincing ocamlopt to be a cross compiler.

If you're interested in trying OCaml on iOS, starting with the simulator
is great because you don't need a device, and you don't need to register
as an iOS developer with Apple.

My next project will be to work on an armv6 version of the OCaml-to-iOS
compiler (which I call OCamlXARM).

I'm very happy to hear from anybody interested in this project
(or any similar ones).

Jeffrey

--
Caml-list mailing list.  Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list:  http://groups.yahoo.com/group/ocaml_beginners
Bug reports:  http://caml.inria.fr/bin/caml-bugs

OCaml 4.00.0 for iOS is released

Mon, 17 Sep 2012 10:13:35 -0700 Post Comments

Greetings OCamlers,

I've released a version of OCaml 4.00.0 that creates iOS apps.  First
class modules and generalized abstract data types for your iPhone and
iPad!

     http://psellos.com/2012/09/2012.09.ocamlxarm-ocaml4-released[..]

If you just want to download the cross compiler or build it from source,
you can go directly to the main OCaml-on-iOS page:

     http://psellos.com/ocaml/compile-to-iphone.html

I also have a page of OCaml-on-iOS resources with many example
apps and an interface to OpenGL ES:

    http://psellos.com/ocaml/

This version of OCamlXARM (my name for the project) generates code only
for the armv7 architecture (in the Thumb encoding), which works on all
iOS devices introduced since September 2009.  Despite some excellent
advice to the contrary, I'm planning to put out a release that also
generates armv6 code (in ARM encoding), which will support all historical
iOS devices.

Thanks to Benedikt Meurer for writing the OCaml 4 ARM code generator,
and for help and advice.  Thanks to my colleagues at SEAiq[1] for helping
with the testing.  Thanks to the OCaml team at INRIA for fixing some
bugs we found in the base OCaml 4.00.0 release (PR 5731[2], PR 5757[3]).

(The SEAiq guys have also recently demonstrated that OCaml threading
works under iOS.  I'll have more about this soon in my sporadic
blog, linked above.)

I'm very happy to hear from anybody interested.

Jeffrey

[1]:  http://www.seaiq.com/
[2]:  http://caml.inria.fr/mantis/view.php?id=5731
[3]:  http://caml.inria.fr/mantis/view.php?id=5757

--
Caml-list mailing list.  Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list:  http://groups.yahoo.com/group/ocaml_beginners
Bug reports:  http://caml.inria.fr/bin/caml-bugs

ARM code generator problem

Fri, 10 Aug 2012 14:42:45 -0700 Post Comments

Greetings,

While working on porting OCaml 4.00.0 to iOS, I ran across
what looks like a problem in the ARM code generation.

If you look at asmcomp/arm/emit.mlp you see lots of places where
s14 is used as a scratch register.  The one that showed up in my
code is the code sequence for float_of_int:

    | Lop(Ifloatofint) ->
        `       fmsr    s14, {emit_reg i.arg.(0)}\n`;
        `       fsitod  {emit_reg i.res.(0)}, s14\n`; 2

Note that the emitted code always uses s14 (unconditionally).  This
suggests that s14 should be set aside as a scratch register.

However, s14 is also an alias for the low order part of d7.  If you look
at asmcomp/arm/proc.ml you'll see that d7 is used as a general purpose
register.

The result is that a value in d7 is sometimes destroyed by a use
of s14 as a scratch register.  In my code it was a call to float_of_int
that destroyed a float value being kept in d7.

I'm wondering if there's any wisdom on the list about this problem.
I don't see anything about it on Mantis.

For my own project, I think I can solve this simply by leaving d7 out of
the list of general registers in proc.ml.  However, this might be a bit
drastic.  Maybe there is a more subtle and wise solution.

You can read about OCaml4-on-iOS progress in my sporadic blog:

     http://psellos.com/2012/07/2012.07.ocamlxarm-ocaml4-1.html

I can provide my OCaml code and the generated ARM code if it will help
show the problem.  I haven't (yet) tried to whittle it down to a small
case.

Regards,

Jeffrey

--
Caml-list mailing list.  Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list:  http://groups.yahoo.com/group/ocaml_beginners
Bug reports:  http://caml.inria.fr/bin/caml-bugs

Read more »

Group(s)
Recent discussion with
Profile Widget
Copy and paste this HTML code to your blog or website: