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 AAA19246 for caml-red; Wed, 26 Jul 2000 00:03:15 +0200 (MET DST) 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 NAA07770 for ; Tue, 25 Jul 2000 13:48:08 +0200 (MET DST) Received: from tcs.inf.tu-dresden.de (tcs.inf.tu-dresden.de [141.76.75.119]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e6PBm7b08041 for ; Tue, 25 Jul 2000 13:48:07 +0200 (MET DST) Received: from ithif20.inf.tu-dresden.de (ithif20 [141.76.75.120]) by tcs.inf.tu-dresden.de (8.9.1a/8.9.1) with ESMTP id NAA14317 for ; Tue, 25 Jul 2000 13:48:06 +0200 (MET DST) Received: (from tews@localhost) by ithif20.inf.tu-dresden.de (8.9.1a/8.9.1) id NAA19039; Tue, 25 Jul 2000 13:48:05 +0200 (MET DST) Date: Tue, 25 Jul 2000 13:48:05 +0200 (MET DST) Message-Id: <200007251148.NAA19039@ithif20.inf.tu-dresden.de> From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: Re: automatic construction of mli files In-Reply-To: References: X-Mailer: VM 6.34 under Emacs 19.34.1 Sender: weis@pauillac.inria.fr Julian Assange writes: From: Julian Assange Date: 24 Jul 2000 15:34:22 +1000 Subject: automatic construction of mli files .mli files are highly redundant. Almost without exception all, or at the vast majority of .mli information can be generated from the underlying .ml implementation. We have programming languages to reduce redundancy, not increase it. Keeping mli and ml files in-sync is not only a waste of time, but error-prone and from my survey often not performed correctly, particularly where consistency is not enforced by the compiler (e.g comments describing functions and types). While exactly the same problem exists in a number of other separate-compilation language implementations, we, as camlers, should strive for something better. I don't share your point of view. We have a big project (>100 files, approx 60000 lines of ocaml code). And the policy regarding mli files is quite simple: If the mli file could be generated from the source code, then, don't write one! The ocaml compiler (together with ocamldep) will recognize its absence and compile the ml file into both a cmo and a cmi file. If, on the other side, you really want to hide some type information, then you provide an mli file and in this case it cannot be generated from the ml file. In our project we have 26 mli files for 63 ml files. The rest is generated by the compiler. Moreover I don't think redundancy is that bad. Redundancy helps you to catch errors. I often write mli files even if they contain only the information that would be infered by the comiler automatically. But this redundant mli file helps me to catch programming errors. Bye, Hendrik