Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Module aliases ideal name-spacing
Date: Wed, 7 Jan 2015 16:15:37 +0100	[thread overview]
Message-ID: <20150107151537.GC17784@frosties> (raw)
In-Reply-To: <87tx0fjoql.fsf@study.localdomain>

On Mon, Dec 29, 2014 at 12:14:58AM +0000, Leo White wrote:
> > The only remaining remnant of the "prefixed"
> > namespace is in myLib.mli/.ml
> >
> >
> >     module MyModule = MyLibMyModule
> >     module Utils = MyLibUtils
> >
> > It would be nice to eliminate that as well, but I could imagine
> > auto-generating these module alias mappings.
> 
> It is certainly feasible to have the build system generate these
> mappings automatically. For example, I believe that Jane Street's
> example build rules for Jenga include support for generating these alias
> mappings (examples/js-build-style/jengaroot.ml in the Jenga source
> code).
> 
> > This
> > sounds like a nice workaround the namespace issue, but do you think it would be worth supporting module aliases
> > themselves as a form of namespacing at compilation time, so that this intermediate prefixed compilation artifact isn't
> > needed?
> 
> I'm aware of a few proposals, and I'm sure something more user-friendly
> will happen at some point, but the details of these proposals are tricky
> and important to get right. For now, the support in 4.02 is at least
> sufficient to have a working replacement for `-pack`.
> 
> Regards,
> 
> Leo

Isn't this just an improvement on pack to reduce code size? As in
sources that only use MyLib.Util will only get MyLibUtil linked in but
not MyLibMyModule.

From a user standpoint a MyLib pack or the MyLib aliases should be the
same. So maybe the build system could use pack for old ocaml and alias
for new ocaml. Packs would work as is and for aliases the build system
would generate the myLib.ml(i) automatically.

Should be fairly easy to do in _oasis, I hope.

MfG
	Goswin

      reply	other threads:[~2015-01-07 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-27 23:04 Jordan W
2014-12-28 18:15 ` Leo White
2014-12-28 20:34   ` Jordo
2014-12-28 21:26     ` Leo White
2014-12-28 23:25       ` Jordan W
2014-12-29  0:14         ` Leo White
2015-01-07 15:15           ` Goswin von Brederlow [this message]

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=20150107151537.GC17784@frosties \
    --to=goswin-v-b@web.de \
    --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