Version franaise
Home About Download Resources Contact us
Browse thread
[ANN] OCaml Batteries Included, alpha 3
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mikkel_Fahnøe_Jørgensen <mikkel@d...>
Subject: Re: [Caml-list] Re: [ANN] OCaml Batteries Included, alpha 3
2009/2/9 Peter Hawkins <hawkinsp@cs.stanford.edu>:
> Hi...
>
> On Mon, Feb 9, 2009 at 1:32 AM, Romain Bardou <Romain.Bardou@lri.fr> wrote:
>> The wiki:

> The documentation on linking Ocaml programs to external C libraries or
> Ocaml libraries with C library dependencies is minimal at best. There
> are some examples in the wiki, but they come with little explanation
> and aren't adequate documentation by themselves.
>

Documention issues aside, external C linking is not at all well
supported in ocamlbuild, for one thing there is no dependency support
and C header files do not automatically get added to the build dir,
and there isn't any good support for different C tool chains - that is
why I wrote ocamlbuild-ctools. More generally ocamlbuild does no very
well support building C code without ocaml either. I hope some of this
could eventually be integrated with ocamlbuild itself or that
ocamlbuild adds module support so it becomes easier to include in ones
own build.

Regarding what is missing in ocaml build environment ... yes
documentation. But there are other issues. Usually these get answered
with - but you just have do ... like install unix tools, or use
ocamlfind with this argument, or something. Yes, it is possible. But
it is much more involved that in scripting languages. I don't have all
the answers. But for example: why is there a need for ocamlfind in the
first place. Couldn't the ocaml compiler tools do the same thing with
a lib path argument, a default location and an environment varible? Or
since it is more or less needed, why isn't it part of the default
installation of ocaml? Why is the path information mixed ocaml/C
libaries so hardcoded that I must copy C libraries to a new path
before creating an ocaml library so it doesn't hardcode some strange
path that makes the library uninstallable. Why is it so difficult to
create libraries with pack arguments - granted ocamlbuild solves many
of these issues. Why can't the compiler figure out the proper link
order of arguments - again ocamlbuild helps. Why can't a name a camlp4
syntax at the top of a file so other users have a chance to figure out
how to read the reminder of the file. Why do I have to link with a
library in the first place when I already referenced the library in
the source code. Again ocamlbuild solves  some of these issues.

There are probably many good reasons and priorities behind this, but
the end result is a more difficult build environment than your typical
scripting language, or even C/C++.

Mikkel