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 AAA05042 for caml-red; Wed, 26 Jul 2000 00:07:43 +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 WAA09978 for ; Tue, 25 Jul 2000 22:48:27 +0200 (MET DST) Received: from mailhub2.isdnet.net (mailhub2.isdnet.net [195.154.209.22]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e6PKmQb19015 for ; Tue, 25 Jul 2000 22:48:26 +0200 (MET DST) Received: from localhost.localdomain (ppp87-paris2.isdnet.net [194.149.182.87]) by mailhub2.isdnet.net (8.9.3/8.9.3) with ESMTP id WAA39075 for ; Tue, 25 Jul 2000 22:46:06 +0200 (CEST) Received: from fnac.net (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.9.3/8.9.3/cf ISP 16/05/00) with ESMTP id WAA01638 for ; Mon, 24 Jul 2000 22:48:23 +0200 Message-ID: <397CAB94.4B458DFB@fnac.net> Date: Mon, 24 Jul 2000 22:48:20 +0200 From: Olivier Andrieu Reply-To: andrieu@oxygene.ijm.jussieu.fr Organization: DEA Genetique Cellulaire et Moleculaire X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i586) X-Accept-Language: fr-FR, fr, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: automatic construction of mli files References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Julian Assange wrote: > > .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. Urmpf. Well, it's still about type abstraction and name hiding isn't it ? The compiler can't decide for you what you want to keep in the interface and what should be hidden. But it's quite easy to generate an mli file with everything in it : ocamlc -i -c mycode.ml > mycode.mli You could even use a Makefile rule : %.mli : %.ml $(OCAMLC) -i -c $^ > $@ Olivier.