From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA11990; Fri, 6 Jun 2003 20:59:44 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA12120 for ; Fri, 6 Jun 2003 20:59:42 +0200 (MET DST) Received: from epexch01.qlogic.org ([63.170.40.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h56IxfT29015 for ; Fri, 6 Jun 2003 20:59:41 +0200 (MET DST) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Fri, 6 Jun 2003 14:01:02 -0500 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Fri, 6 Jun 2003 14:01:02 -0500 Date: Fri, 6 Jun 2003 14:16:59 -0500 (CDT) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Chris Hecker cc: Brian Hurt , Stefan Heimann , Ocaml Mailing List Subject: Re: [Caml-list] Automatic generation of mli files In-Reply-To: <4.3.2.7.2.20030606112653.039b1838@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 06 Jun 2003 19:01:02.0075 (UTC) FILETIME=[F92FDCB0:01C32C5D] X-Spam: no; 0.00; qlogic:01 caml-list:01 mli:01 hecker:01 pasting:01 foo:01 inference:01 val:01 cross-module:01 inlining:01 compiler:01 chris:01 ocaml:01 imho:01 writting:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 6 Jun 2003, Chris Hecker wrote: > > >Not sure what advantage this would gain. Step #1 is about as difficult as > >simply writting the .mli file directly. > > Yeah, but not if things are changing a lot and you have big types and > whatnot. Cutting and pasting or doing the ocaml -i thing is a bit of a > pain. I could see it being a useful tool. Basically anything that > eliminates repetition is a positive. My basic opinion here: feel free to create such a tool. Have fun. *I* won't use it, but it's no skin off my nose either way. If I'm heavily modifying a file *and* it's interface, I generally don't even bother with a .mli file. That gets generated when the interface settles down. If you're making big changes in the interface *and* have other files that depend upon the interface you're trying to keep up to date, then you're going to be having fun anyways. Be thankfull the compiler detects all of those places you forgot to update. Here's one problem I've hit several times. In the .ml file, I do something like: type t = foo * bar * bang Then several functions that use type t. The type inference will come up with types like: val add: foo * bar * bang -> foo -> bar -> bang -> foo * bar * bang when what I wanted was: vall add: t -> foo -> bar -> bang -> t How do you deal with this? > > >I don't have a problem with .mli files being seperate from .ml files for > >two reasons: > >1) .mli is your external interface- > >2) The compiler checks the signature of the .mli file > > Don't forget "3) having a separate interface allows you to decouple > implementations which is important for large scale software". Oh wait. > Function calls are about 1-1.5 clock cycles the last time I measured them. I wouldn't have a problem if ocaml disabled all cross-module inlining. Inlining within a module is, IMHO, critical- but between modules I would bet is sigifigantly less important. People who have hard numbers feel free to jump in. Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners