From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA04245 for caml-red; Sun, 7 Jan 2001 21:22:28 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA31757 for ; Sun, 7 Jan 2001 17:02:59 +0100 (MET) Received: from codex.cis.upenn.edu (CODEX.CIS.UPENN.EDU [158.130.6.15]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f07G2o503356 for ; Sun, 7 Jan 2001 17:02:51 +0100 (MET) Received: from tasurinchi (TASURINCHI.CIS.UPENN.EDU [158.130.6.146]) (authenticated) by codex.cis.upenn.edu (8.10.1/8.10.1) with ESMTP id f07G2kT05519; Sun, 7 Jan 2001 11:02:47 -0500 (EST) From: "Michael Hicks" To: "Charles Martin" , Subject: RE: Module hierarchies Date: Sun, 7 Jan 2001 11:07:50 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal In-Reply-To: <5.0.0.25.0.20010106112842.00a3eeb0@chasm.org> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: weis@pauillac.inria.fr > 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