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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 95FDC7EE6A for ; Fri, 31 May 2013 17:42:07 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUAAErDqFEmacjlnGdsb2JhbABagzmsSYlniDt6Hg4BAQEBAQYNCQkUKIIjAQEEAUABASwLAQQLCwsDCg0hIQESAQUBChIGExKHaQMJBgMJnFaLCYQ+AQWFPgMKiF4GjEiCVQQHg1eTcIFrgWaBKYp0gz4WKYJaJIFT X-IPAS-Result: AoUAAErDqFEmacjlnGdsb2JhbABagzmsSYlniDt6Hg4BAQEBAQYNCQkUKIIjAQEEAUABASwLAQQLCwsDCg0hIQESAQUBChIGExKHaQMJBgMJnFaLCYQ+AQWFPgMKiF4GjEiCVQQHg1eTcIFrgWaBKYp0gz4WKYJaJIFT X-IronPort-AV: E=Sophos;i="4.87,779,1363129200"; d="scan'208";a="19813064" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 May 2013 17:42:06 +0200 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1UiRSt-0006Tr-69 for caml-list@inria.fr; Fri, 31 May 2013 11:42:03 -0400 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UiRSt-0005Vj-5J for caml-list@inria.fr; Fri, 31 May 2013 11:42:03 -0400 Received: from mail-ea0-f175.google.com ([209.85.215.175]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1UiRSs-0001do-04 for caml-list@inria.fr; Fri, 31 May 2013 11:42:02 -0400 Received: by mail-ea0-f175.google.com with SMTP id h14so1759416eaj.34 for ; Fri, 31 May 2013 08:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MQMJI3MwbJKIL7GVgR16u1hYWtBo4xnfjW+dNVuJMTg=; b=R05Q37S3udq409LLVtCP+V1m0gYpSAfjwSe2KZv1LxFb4YAG59g1ICjdC7SnNF3qLe ECNu77DSVMEYI9kozb0iN6P69RRlaojdfoM/GCDspZhYXB0QtKogi0Eo4jjcO/EFfAol t+4ui2nZzxAo6RvpvwkQfHtL/AoMU8jEHBMnM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=MQMJI3MwbJKIL7GVgR16u1hYWtBo4xnfjW+dNVuJMTg=; b=F9j7sf26vOR/Vwz0TtFVtzOBhh5ZHHp1pAgI6PUdisWbitiOVBqcy7rOPRTHT36EqK dposqlVqW1w7/QKzRLi7RqP+bIBNSAYSzmLnDBohcOzBaxBSGq4MHfr0s7vqRSJdLydH Mvxj5aaWVsZg6oEQWO1MXLUZh7bs2AkeWWNEEyEjXdCIbAgosOjgJ3W0wnm1KkYNfn7m wc6GOlIhBwbf0Yput04arlcWZKnMUAH575BInFLxp6eECkTcA18qlIb0HOuFoT8i1uvH xhW3cCK0X4Qck52c5tbM+XZQfCuUTTRczNuJy6rE/rWQG8nRP6p9IX8QAkBHDj/ioiaM NoYQ== X-Received: by 10.14.202.71 with SMTP id c47mr13998294eeo.87.1370014921421; Fri, 31 May 2013 08:42:01 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.14.202.71 with SMTP id c47mr13998284eeo.87.1370014921322; Fri, 31 May 2013 08:42:01 -0700 (PDT) Received: by 10.223.43.14 with HTTP; Fri, 31 May 2013 08:42:00 -0700 (PDT) Received: by 10.223.43.14 with HTTP; Fri, 31 May 2013 08:42:00 -0700 (PDT) In-Reply-To: <51A8BFE4.9060709@gmail.com> References: <51A81C67.50902@riken.jp> <87bo7rogub.fsf@gmail.com> <51A8BFE4.9060709@gmail.com> Date: Fri, 31 May 2013 11:42:00 -0400 Message-ID: From: Yaron Minsky To: Hongbo Zhang Cc: caml-list@inria.fr, Francois Berenger , Malcolm Matalka Content-Type: multipart/alternative; boundary=047d7b343e38b925bb04de05741d X-Gm-Message-State: ALoCoQlrBfc6zZlpk6kE1JN/E1s25sXfesW+D2dsBlU+tXYTYUUY1wEd24OvScK+sSd932nLJvw5mEBQFYgQsrepFWEK744LjUkdMF5/+pbPdJT9JN1L8AFrtGKgw22+apITcQOKq0/CUOTrzK9tJWh+e7ellU6prg== Subject: Re: [Caml-list] Re: automatic extaction of the .mli (and a little more) from the .ml --047d7b343e38b925bb04de05741d Content-Type: text/plain; charset=ISO-8859-1 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 > --047d7b343e38b925bb04de05741d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

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; <bobzhang1988@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
--047d7b343e38b925bb04de05741d--