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 XAA26131 for caml-red; Tue, 25 Jul 2000 23:50:22 +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 AAA19548 for ; Tue, 25 Jul 2000 00:03:01 +0200 (MET DST) Received: from csla.csl.sri.com ([192.12.33.2]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e6OM2wj16052 for ; Tue, 25 Jul 2000 00:02:59 +0200 (MET DST) Received: from cylinder.csl.sri.com (IDENT:root@cylinder.csl.sri.com [130.107.15.112]) by csla.csl.sri.com (8.9.1/8.9.1) with ESMTP id PAA21757; Mon, 24 Jul 2000 15:02:56 -0700 (PDT) Received: (from filliatr@localhost) by cylinder.csl.sri.com (8.9.3/8.8.7) id PAA05276; Mon, 24 Jul 2000 15:02:56 -0700 X-Authentication-Warning: cylinder.csl.sri.com: filliatr set sender to filliatr@cylinder.csl.sri.com using -f From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14716.48400.141405.743737@cylinder.csl.sri.com> Date: Mon, 24 Jul 2000 15:02:56 -0700 (PDT) To: Julian Assange Cc: caml-list@inria.fr Subject: Re: automatic construction of mli files In-Reply-To: References: X-Mailer: VM 6.62 under Emacs 20.7.1 Reply-To: filliatr@csl.sri.com (Jean-Christophe Filliatre) Sender: weis@pauillac.inria.fr > .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. [...] We probably don't use interfaces (.mli files) in the same way. Personally, I write the interface *before* the code. It clarifies the design of an implementation, helping you focusing first on the features of the module, independently of the way you will write it. Therefore, there is no way of generating the .mli from the .ml, since it comes first. Moreover, I don't put the same kind of documentation in the interface and in the code: in the interface I put specifications, mainly, and in the code I put implementation details. In the extreme situation where there is no real need for writing an interface, you can either simply not write one (this is not mandatory) or generate it from the code with "ocamlc -c -i". But writing an interface is always a good idea, since it encourages you to abstract data types and to provide only small and orthogonal sets of functions, which cannot be done automatically in most cases. -- Jean-Christophe Filliatre Computer Science Laboratory Phone (650) 859-5173 SRI International FAX (650) 859-2844 333 Ravenswood Ave. email filliatr@csl.sri.com Menlo Park, CA 94025, USA web http://www.csl.sri.com/~filliatr