Loading ...
Sorry, an error occurred while loading the content.

12981Re: "ocaml_beginners"::[] Any experience using oasis?

Expand Messages
  • Gabriel Scherer
    Dec 1, 2011
      Makefiles, and more generally build and packaging tools of the
      Unix-like communities, tend to be designed to work well with the
      language C, and sometimes do not work so well with languages having
      different, stricter assumptions about how compilation should be done.

      Here are a few examples that may or may not be true, I'm no build system expert:
      1. C compilers are extremely lenient about compile order; basically
      you can give *.c files in any order you like, there is no cross-file
      dependency (but a common inclusion of .h files in the source) before
      linking; on the contrary OCaml is quite strict to get file paths in
      correct dependency order. Some build systems are impractical if you
      need strict file ordering, as they assume order doesn't matter so
      much.
      2. C files quite rarely need to be recompiled, as they deduce outside
      interfaces from their .h rather than depending on other modules, and
      have a quite lenient compatibility story; on the contrary, OCaml has
      an overly strict technique to guarantee type safety and representation
      coherence, it computes hashes of whole compilation units and require
      all files depending on them to be recompiled if their change

      Makefile caching mechanism will typically not be aware of point (2),
      which explains the not-infrequent "foo.cmi and bla.cmi makes
      inconsistent assumptions" error message. ocamlbuild tries to take care
      of this aspect. You have the same problem on the packaging/deployment
      front: usual Unix packaging systems do not expect to have to upgrade,
      say, the 'lwt' package whenever the 'ocaml' package gets an upgrade.
      GODI and, for example, the Debian ocaml packaging team, use special
      techniques to force recompilation / binary upgrade.

      On Thu, Dec 1, 2011 at 8:54 AM, <rixed@...> wrote:
      > If I can add a related question I've always been afraid to ask: what does ocaml
      > custom build systems bring over general-purpose and comunity-agnostic
      > Makefiles?  We already heard about portability to windows, is there anything
      > else?
      >
      >
      >
      > ------------------------------------
      >
      > Archives up to December 31, 2010 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners
      > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
      > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
      >
      >
      >
    • Show all 13 messages in this topic