caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Michael Hicks" <mwh@dsl.cis.upenn.edu>
To: "Charles Martin" <martin@chasm.org>, <caml-list@inria.fr>
Subject: RE: Module hierarchies
Date: Sun, 7 Jan 2001 11:07:50 -0500	[thread overview]
Message-ID: <MABBJDLGAJOFDJKIGNELGEBOCAAA.mwh@dsl.cis.upenn.edu> (raw)
In-Reply-To: <5.0.0.25.0.20010106112842.00a3eeb0@chasm.org>

> I am wondering how a large OCaml project might be structured, specifically
> in terms of directories and files.  I see that the OCaml compiler is
> structured as a one-level collection of directories, with the Makefile
> drawing them all together.  There's no hierarchy here; the directory
> structure is used to partition major components of the system.

In my experience with Ocaml (two projects of 10's of thousands of lines of
code), typically one or two levels of hierarchy has been sufficient, tied
together with a single Makefile or "included" sub-Makefiles, and judicious
use of -I to get all of the dependencies right.  For a while, we used
"recursive" make, having separate makefiles in each subdirectory, but then
realized that this can lead to (and did, in our case) lots of unnecessary
recompilation---see "Recursive Make considered Harmful"
(http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html) for more on
this, and good suggestions for structuring large projects.

> I'm used to thinking about breaking large projects down into smaller and
> smaller hierarchical subcomponents.  I think the Java mapping between
> package structure and directory structure helps, and I wonder whether
> something similar could be useful for OCaml?

I personally don't like the Java notion packages being so tightly tied to
the filesystem, as it makes components less reusable: if you move where your
package is, you have to go change all of the other files that reference it;
in Ocaml, you can just change -I to point where you want.

Mike



  parent reply	other threads:[~2001-01-07 20:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-06 19:32 Charles Martin
2001-01-07 10:10 ` Mattias Waldau
2001-01-07 16:07 ` Michael Hicks [this message]
2001-01-09  8:03   ` John Max Skaller
2001-01-07 20:37 ` Vitaly Lugovsky
2001-01-08 10:24 ` Xavier Leroy
2001-01-08 14:01   ` Judicael Courant
2001-01-09 16:46 Dave Berry
2001-01-10  9:40 ` Markus Mottl
2001-01-09 17:34 Daniel Ortmann
2001-01-09 18:06 Dave Berry
2001-01-10 20:12 ` Gerd Stolpmann
2001-01-11 12:53 Dave Berry

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=MABBJDLGAJOFDJKIGNELGEBOCAAA.mwh@dsl.cis.upenn.edu \
    --to=mwh@dsl.cis.upenn.edu \
    --cc=caml-list@inria.fr \
    --cc=martin@chasm.org \
    /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).