caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: whitequark <whitequark@whitequark.org>
To: Raoul Duke <raould@gmail.com>
Cc: Gerd Stolpmann <info@gerd-stolpmann.de>, OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] whither portability?
Date: Sat, 26 Sep 2015 18:59:50 +0300	[thread overview]
Message-ID: <e362fc9688066d13af18b848035e02de@whitequark.org> (raw)
In-Reply-To: <CAJ7XQb6pcWOzcLgt9U7UpFf0fV4MHhWLtMdmR=wszzwi-3zy5Q@mail.gmail.com>

I will offer a few comments as the author of opam-android[1].

On 2015-09-26 15:48, Raoul Duke wrote:
> Exciting to hear! Thank you and your contributors for this work. I
> know there are ways people can be parochial, but I have never been
> able to fathom how the core OCaml team can ignore mobile so actively,
> it seems. It is to sigh, oy veh.

No one is being parochial or "actively" ignoring mobile. The OCaml core
team consists of unpaid volunteers. I suggest that next time, in place
of a snide remark, you contribute some code and/or money.

That being said...

> 
> Throwing out random ideas as a potential some-day user of such a thing:
> 
> * Getting anything working as simply as possible would be a nice first
> step, even if it isn't the most performant. I.e. bytecode. It seems
> Apple has loosened up on that a bit over the years? And I wonder if
> LLVM bytecode would be no problem with them now.

Both ocamlc and ocamlopt work for iOS and Android; there is not really
a good reason to use the bytecode compiler for deployment to mobile.

There is no such thing as "LLVM bytecode" and LLVM bitcode (sic)
is merely an intermediate format for native executable code. Shipping
LLVM bitcode offers no conceptual improvement over shipping
machine code and in any case, there is neither an LLVM backend
for ocamlopt nor much need for such a backend.

> 
> * FFI will be essential. It is one thing to have 2+2 working on
> mobile, it is another to be able to get any real app work done. (In
> the past I have had some negative experiences with OCaml and FFI for
> OpenGL so I am always a little worried about trying to reignite my
> relationship with OCaml.)

Definitely. ocaml-ctypes[2] in cstubs mode allows bidirectional
integration of OCaml code with C code, i.e. OCaml can call into C
and C can call into OCaml. Daniel Bünzli's tgls OpenGL bindings
can be made to compile in cstubs mode, but this is not quite
upstream yet[2].

> 
> * Ideally it has to integrate well with the platform toolchains,
> including the preferred IDEs. E.g. if there's no good installer, if I
> have to do a lot of work to build things, etc., then I'm way less
> likely to even try to use it. I know that is work most people do not
> like to do. I say that empirically.

With opam-android, the workflow is exactly identical to building any
regular OCaml project, with the difference that the final binary 
produced
is a .o or .so file that you can use as any other C library in
your Android project; the Android cross-toolchain is just another switch
in opam.

I don't know how it works for iOS but it is almost certainly possible
to achieve the same level of convenience.

[1]: https://github.com/whitequark/opam-android
[2]: https://github.com/dbuenzli/tgls/pull/14

-- 
whitequark

  reply	other threads:[~2015-09-26 15:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 21:13 Raoul Duke
2015-09-26  9:28 ` Gerd Stolpmann
2015-09-26 12:48   ` Raoul Duke
2015-09-26 15:59     ` whitequark [this message]
2015-09-26 16:21       ` Gerd Stolpmann
2015-09-26 23:29       ` Raoul Duke
2015-09-27  0:47         ` Spiros Eliopoulos
2015-09-27  0:51           ` Raoul Duke
2015-09-27  0:20       ` Oliver Bandel
2015-09-27  0:27         ` Yotam Barnoy
2015-09-27 14:10           ` Oliver Bandel
2015-09-27  0:55       ` Raoul Duke
2015-09-27 14:33         ` whitequark
2015-09-27 17:19           ` Raoul Duke
2015-09-27 17:41             ` whitequark
2015-09-26 17:10     ` Gerd Stolpmann

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=e362fc9688066d13af18b848035e02de@whitequark.org \
    --to=whitequark@whitequark.org \
    --cc=caml-list@inria.fr \
    --cc=info@gerd-stolpmann.de \
    --cc=raould@gmail.com \
    /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).