From: Jean-Christophe Filliatre <filliatr@csl.sri.com>
To: Julian Assange <proff@iq.org>
Cc: caml-list@inria.fr
Subject: Re: automatic construction of mli files
Date: Mon, 24 Jul 2000 15:02:56 -0700 (PDT) [thread overview]
Message-ID: <14716.48400.141405.743737@cylinder.csl.sri.com> (raw)
In-Reply-To: <wxhf9gytup.fsf@foo.iq.org>
> .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
next prev parent reply other threads:[~2000-07-25 21:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-24 5:34 Julian Assange
2000-07-24 20:48 ` Olivier Andrieu
2000-07-26 16:03 ` John Max Skaller
2000-07-24 22:02 ` Jean-Christophe Filliatre [this message]
2000-07-26 16:09 ` John Max Skaller
2000-07-24 22:09 ` John Prevost
2000-07-24 23:14 ` David Brown
2000-07-25 1:13 ` Jacques Garrigue
2000-08-01 11:22 ` Anton Moscal
2000-08-02 12:03 ` Dmitri Lomov
2000-08-02 14:13 ` Gerard Huet
2000-07-25 11:48 ` Hendrik Tews
2000-07-26 10:16 ` David Delahaye
2000-07-26 12:58 Damien Doligez
2000-07-27 17:46 ` Francois Rouaix
2000-07-27 19:04 Damien Doligez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14716.48400.141405.743737@cylinder.csl.sri.com \
--to=filliatr@csl.sri.com \
--cc=caml-list@inria.fr \
--cc=proff@iq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox