[wg-windows] Improving the state of OCaml on Windows

Yotam Barnoy yotambarnoy at gmail.com
Mon Jun 1 19:01:33 BST 2015


>
>
> Ideally, a simple pure OCaml package should be buildable by a simple
> invocation of (native) ocamlbuild.exe without requiring a cygwin
> environment.
>
>
I completely agree with this.

I've been looking more into the different build options for OCaml over the
last couple of days, and it's a shame ocamlbuild punted on the job of task
multiplexing (installing different configurations and options and such) and
left it to makefiles and shell scripts. It seems like myocamlbuild.ml can
sometimes do part of this task, but projects that use myocamlbuild.ml also
have shell scripts or makefiles to multiplex different build options.

You then get some projects using OASIS, where some multiplexing is done
from the declarative layer, and all other files are built automatically,
but even then a Makefile is usually created by OASIS as the entry point.

It appears that there's no way to get around this issue. We need some
scripting language as a compilation front-end, but we don't want to invent
a new one (like OMake) since that's another cognitive burden. At the same
time, everyone agrees that Makefile rules are painful, as is bash
scripting, and worst of all, they're not cross-platform compatible.

For the front end, one option is to do the scripting inside something like
myocamlbuild.ml, which ocamlbuild makes sure to only compile when needed.
If the right cross-platform libraries are automatically imported, this can
be made relatively painless. But another option is to use something like
python scripting. Python is available on just about every system, and the
python devs have already dealt with cross-platform issues, which means a
python layer over ocamlbuild or python generated by OASIS and customized
could be much cleaner and more cross-platform compatible than the current
situation with Makefiles and shell scripts.

For the backend, ocamlbuild seems to be inadequate on its own once complex
C integration is required, mostly because its automatic dependency search
is really targeted at ocaml only. I've seen a claim that ocamlbuild can
build the entire ocaml compiler, and I'd like to see if that's really
possible. If so, perhaps a switch-over is worth considering for
simplicity's sake?

-Yotam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/wg-windows/attachments/20150601/1db64493/attachment.html>


More information about the wg-windows mailing list