From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 791BE7EE6A for ; Sat, 1 Jun 2013 01:21:01 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rathereasy@gmail.com) identity=pra; client-ip=209.85.192.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="rathereasy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rathereasy@gmail.com designates 209.85.192.181 as permitted sender) identity=mailfrom; client-ip=209.85.192.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="rathereasy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pd0-f181.google.com) identity=helo; client-ip=209.85.192.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="postmaster@mail-pd0-f181.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgBAAkwqVHRVcC1m2dsb2JhbABZgzmJUaMKiWeIOxlhCBYOAQEBAQEGCwsJFCiCGwgBAQQBQAEbEgsBAwELBgULDQ0hIQEBEQEFAQoSGRKFZIIEAQMJBgybcYxKgn2EaQoZJwMKWIglAQUMjDyCVQQHglGBBgOJIIpNgWuBZoEpinSDPhYpglokgVcc X-IPAS-Result: AhgBAAkwqVHRVcC1m2dsb2JhbABZgzmJUaMKiWeIOxlhCBYOAQEBAQEGCwsJFCiCGwgBAQQBQAEbEgsBAwELBgULDQ0hIQEBEQEFAQoSGRKFZIIEAQMJBgybcYxKgn2EaQoZJwMKWIglAQUMjDyCVQQHglGBBgOJIIpNgWuBZoEpinSDPhYpglokgVcc X-IronPort-AV: E=Sophos;i="4.87,781,1363129200"; d="scan'208";a="16382442" Received: from mail-pd0-f181.google.com ([209.85.192.181]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jun 2013 01:20:52 +0200 Received: by mail-pd0-f181.google.com with SMTP id bv13so2917074pdb.26 for ; Fri, 31 May 2013 16:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=ZtxIIu6AsF2yIbbzfGuB5jNUebdptGv3sZQJgSukX0Q=; b=gt1OetaS+vC3OhYnklhijjHe3Y3jofC6LeTK3BfIfIjDKF/+/u1Zq/lZzup9McdSgl yz6GlWgv1aRYfdHNFmrg/EV/tSV0hZ2MhgExVbxR3WVvfC2mgEBSD4lP34N35oxrtDyG M31sWwb6CayS5ySfb6qd01ykaad5rdYiMjRfUsV3WKbjyLriBHbRPDta8ty1hVVIJyXk UKMJaOBIvVG61+hlgtCVukNjokq8AR1N/bEOEC7slZpMJwRP+bXD5R7WYpT2s0eoZUTh r3AJz8PCA5e5orOcMj3SQmMnTTppCoqQ/XT5Flc31DbLoNX0bYL0iw8tYFmCy14RG581 YE5Q== MIME-Version: 1.0 X-Received: by 10.68.247.131 with SMTP id ye3mr15237083pbc.87.1370042450913; Fri, 31 May 2013 16:20:50 -0700 (PDT) Received: by 10.70.47.225 with HTTP; Fri, 31 May 2013 16:20:50 -0700 (PDT) Received: by 10.70.47.225 with HTTP; Fri, 31 May 2013 16:20:50 -0700 (PDT) In-Reply-To: References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com> <51A8BFE4.9060709@gmail.com> Date: Fri, 31 May 2013 16:20:50 -0700 Message-ID: From: Jacques Le Normand Cc: caml Content-Type: multipart/alternative; boundary=047d7b2e0e3d9d330c04de0bdd3d Subject: Re: [Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml --047d7b2e0e3d9d330c04de0bdd3d Content-Type: text/plain; charset=ISO-8859-1 I'm surprised no one has mentioned that it can speed up compilation by not having to recompile cmx files unnecessarily. On May 31, 2013 8:42 AM, "Yaron Minsky" wrote: > I concur. I think this is largely the accepted wisdom among experienced > OCaml developers. > > y > On May 31, 2013 11:21 AM, "Hongbo Zhang" wrote: > >> On 5/31/13 1:31 AM, Malcolm Matalka wrote: >> >>> I know of no such tool, but in counter to your premise: I used to think >>> maintaining a .ml and .mli was foolish, however I no longer do. .mli is >>> effectively documentation for me. It contains a lot of comments and is >>> generally written to reflect how the API should be used rather than the >>> order in which I must express functions to get ta .ml to compile. On >>> top of that, ocamlc will fail to compile if your .ml and .mli don't >>> match, so it's a valuable check that what I think my module does is also >>> what the compiler does. I also tend to write the .mli first, then write >>> the .ml. I find it to be a great way to develop. >>> >>> In short, I think it's a good thing to maintain these things by hand. >>> But as for your original question I'm completely useless, sorry. >>> >>> I had the same experience with you, after writing some large software >> in ML, I found it better to maintain mli by hand. >> >>> /M >>> >>> Francois Berenger writes: >>> >>> Hello, >>>> >>>> Is there some recommended tool/script to generate a .mli >>>> from the corresponding .ml? >>>> >>>> I want a little more than ocamlc -i: >>>> >>>> - I think there should be tags in the .ml file as comments >>>> that say "export this" to the .mli. >>>> By default, things are not exported. >>>> - maybe it should have an option to say to replicate >>>> the ocamldoc comments in the .mli. >>>> - it could be nice if the order in which things are exported >>>> to the .mli can be specified, maybe as an argument of the tag. >>>> So that the .mli can be more readable (only backward references >>>> to concepts, etc.) >>>> >>>> If there is a need to create a tool, let's call it "nomli". :) >>>> >>>> Regards, >>>> F. >>>> >>>> PS: I'm not going to maintain both a .mli and a .ml. >>>> I feel it is a dumb and error-prone job and that >>>> itches me. >>>> >>> >>> >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/**arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-**bugs >> > --047d7b2e0e3d9d330c04de0bdd3d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I'm surprised no one has mentioned that it can speed up = compilation by not having to recompile cmx files unnecessarily.

On May 31, 2013 8:42 AM, "Yaron Minsky"= ; <yminsky@janestreet.com&= gt; wrote:

I concur.=A0 I think this is largely the accepted wisdom amo= ng experienced OCaml developers.

y

On May 31, 2013 11:21 AM, "Hongbo Zhang&quo= t; <bobzhang= 1988@gmail.com> wrote:
On 5/31/13 1:31 AM, Malcolm Matalka wrote:
I know of no such tool, but in counter to your premise: I used to think
maintaining a .ml and .mli was foolish, however I no longer do. =A0.mli is<= br> effectively documentation for me. =A0It contains a lot of comments and is generally written to reflect how the API should be used rather than the
order in which I must express functions to get ta .ml to compile. =A0On
top of that, ocamlc will fail to compile if your .ml and .mli don't
match, so it's a valuable check that what I think my module does is als= o
what the compiler does. =A0I also tend to write the .mli first, then write<= br> the .ml. =A0I find it to be a great way to develop.

In short, I think it's a good thing to maintain these things by hand. But as for your original question I'm completely useless, sorry.

I had the same experience with you, after writing some large software in ML= , I found it better to maintain mli by hand.
/M

Francois Berenger <berenger@riken.jp> writes:

Hello,

Is there some recommended tool/script to generate a .mli
from the corresponding .ml?

I want a little more than ocamlc -i:

- I think there should be tags in the .ml file as comments
=A0 =A0that say "export this" to the .mli.
=A0 =A0By default, things are not exported.
- maybe it should have an option to say to replicate
=A0 =A0the ocamldoc comments in the .mli.
- it could be nice if the order in which things are exported
=A0 =A0to the .mli can be specified, maybe as an argument of the tag.
=A0 =A0So that the .mli can be more readable (only backward references
=A0 =A0to concepts, etc.)

If there is a need to create a tool, let's call it "nomli". := )

Regards,
F.

PS: I'm not going to maintain both a .mli and a .ml.
=A0 =A0 =A0I feel it is a dumb and error-prone job and that
=A0 =A0 =A0itches me.



--
Caml-list mailing list. =A0Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs
--047d7b2e0e3d9d330c04de0bdd3d--