caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <frisch@clipper.ens.fr>
To: Claudio Russo <crusso@microsoft.com>
Cc: Brian Rogoff <bpr@best.com>, Caml list <caml-list@inria.fr>
Subject: first class, recursive, mixin modules (was: RE: first class modules)
Date: Wed, 10 Jan 2001 22:34:45 +0100 (MET)	[thread overview]
Message-ID: <Pine.GSO.4.04.10101102103300.21442-100000@clipper.ens.fr> (raw)
In-Reply-To: <112C6E8A1B25D34BB27D48D2FD2E96CFC9DED1@TVP-MSG-02.europe.corp.microsoft.com>

On Wed, 10 Jan 2001, Claudio Russo wrote:

> Moscow's recursive modules have the advantage that they
> leverage many of the concepts already existing in the Definition. If I
> recall correctly, they require one new kind of semantic object, a simple
> generalisation of enrichment, and two new syntactic constructs with
> associated evaluation and typing rules. Current main drawbacks: heavy
> syntax requiring forward declarations,
>  no support for cross-compilation-unit recursion and recursion on module
> terms requires a dynamic check for each
> forward reference (this is because the implementation imposes no
> restriction on whether the recursion is safe or not, forcing a dynamic
> check for definedness).

Are there real examples using recursive modules with these restrictions ?

You can always define everything outside the structures (or in the first
one), then copy the types and values in the structures. Of course, you
loose the modularity of definitions, but with recursive modules as in
MosML, you loose the static typing for the module language (Bind
exceptions) and also the modularity (different source files;
separate compilation). 

If you accept runtime checks, the solution adopted
in the OCaml compiler to break the circle of dependencies between
the Core and Module type checkers (forward declaration with a reference
updated when the definition is available) has the advantage of retaining
separate compilation.


Back to first class packaged modules: a very useful feature for runtime
configuration of applications would be the possibility to load the
packages from the disk/network (that is, dynamic loading; the
signature of trusted packages can be checked as in the Dynlink module).


About mixins: what is the proposed dynamic semantic ?  I guess the
evaluation of the mixins, which can have side effects or depend on the
environment, is done when then composition yields a fully defined
structure. But this operation involves a reordering of the definitions,
so it may be non trivial to predict the evaluation order of the different
fields. Is there a requirement for the ordering to be compatible when
possible with the order of definition for values/submodule in each mixin
of the composition ?


-- 
  Alain Frisch



  reply	other threads:[~2001-01-11  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 10:32 first class modules (was: alternative module systems) Claudio Russo
2001-01-10 21:34 ` Alain Frisch [this message]
2001-01-11 10:32 first class, recursive, mixin modules (was: RE: first class modules) Claudio Russo

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=Pine.GSO.4.04.10101102103300.21442-100000@clipper.ens.fr \
    --to=frisch@clipper.ens.fr \
    --cc=bpr@best.com \
    --cc=caml-list@inria.fr \
    --cc=crusso@microsoft.com \
    /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).