caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Julian Assange <proff@iq.org>
To: caml-list@inria.fr
Cc: proff@iq.org
Subject: Re: autogeneration of *.mli files
Date: 26 Jul 2000 21:43:32 +1000	[thread overview]
Message-ID: <wx8zupyv4r.fsf@foo.iq.org> (raw)


Thanks for all your comments on this issue. I'll try and respond more
tomorrow, but for now here's a quick summary of my thoughts:

        o The current mli situation is not nearly as bad as I was
          previously led to believe.

        o I didn't know about ocaml -c -i

        o I didn't know that symbols could be accessed safely from differing
          *.ml files, without writing an *.mli interface

        o While I'm only relatively new to ocaml, the fact that I
          didn't know these two implementation points, yet feel
          reasonably comfortable with the language proper shows a
          weakness in the documentation.
          
        o There is a need for a a tutorial (in English) on the
          interaction of ocaml tools, symbols and program
          structure. Something like `Creating non-trivial software
          projects with Ocaml'. Which takes one through:

                o how to call the compiler
                o using OcamlMakefile and other build tools
                o when and where to use seperate .ml files
                o name space issues
                o encapsulation and modularisation of functions and types
                o in what circumstances one should write .mli files
                o calling ocaml -c -i
                o linking in external libraries
                o objects vs modules
                o when to use the debugger
                o example design-compile-edit-debug-optimise cycles that
                  work for experienced O'caml coders.

        Hopefully the Oreilly book will address some of this.

        o If one doesn't use *.mli files, are there issues of name-space polution?
          Does using a mli interface actually prevent exports of symbols not
          defined in the interface?

        o While ocaml -c -i exports types, I presume it doesn't export
          comments, and that it exports many more types than you would
          normally want in your .mli interface? Even a flag to export
          the immediately preceding comment would be useful.

        o While a number of people talked about writing *.mli's by
          hand for design purposes, it seems to me me that the vast majority
          of mli's have their genesis from ocaml -c -i.

        o To examine the behavior of type inference, I often send code fragments
          to the top-level. It would be nice to a version of ocaml -c -i which
          `annotated' ml code in context, either as type decelerations or commented
          out type declerations, rather than just spitting out the types on their
          own. This would improve program readability without sacrificing the
          benefits of type inference. Doesn't efuns do something like this?

        o For those people who really do write to .mli specs, how about the
          reverse, annotation of .ml files based on comments and types in
          the corresponding .mli?

        o Reading unfamiliar ocaml code that has no comments or type
          annotations is usually substantially harder than code that has
          them. Cut and pasting comments and or type declarations to and
          from mli and ml files strikes me as a waste of human
          intelligence. Obviously others feel the same way, which is mli
          files are often out of sync with correspinding ml files.

Cheers,
Julian.



             reply	other threads:[~2000-07-27 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-26 11:43 Julian Assange [this message]
2000-07-28  9:09 ` Sven LUTHER
2000-08-03  5:44   ` Jacques Garrigue

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=wx8zupyv4r.fsf@foo.iq.org \
    --to=proff@iq.org \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).