zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@fysh.org>
To: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: Module hierarchies, aliasing, and dependencies
Date: Sun, 10 Sep 2000 22:35:00 +0100 (BST)	[thread overview]
Message-ID: <E13YEke-0007UG-00@crucigera.fysh.org> (raw)
In-Reply-To: <E13YESW-00031m-00.2000-09-10-22-16-16@mail1.svr.pol.co.uk> from Peter Stephenson at "Sep 10, 2000 10:16:14 pm"

Peter Stephenson wrote:
>"Bart Schaefer" wrote:
>> Wouldn't it be better to rely on a symbol that's defined *inside* the
>> module to determine whether a module has been loaded?  Similar to the way
>> (provides 'name) works in emacs libraries?
>
>Yes, this sounds better.  That would have fixed [some of] Will's
>difficulties.  Also, I've been wondering for a while how to provide a test
>version of a module under a different name.  This would be a good solution.

There's an issue here, that a module that calls functions from another
module can't be loaded at the dlopen() level (depending on system).
The module dependency system is there to handle this, but it will
have problems with the kind of scheme you describe.  For example,
zsh/deltochar depends on zsh/zle: with dependencies set up right,
zsh/zle will be loaded automatically before zsh/deltochar.  But if you
load zsh/deltochar under the name "local/deltochar" (or just "deltochar",
or anything else) zsh/zle won't be loaded first, and so the load will fail
(unless zsh/zle was already loaded).

There's another issue that on some systems name clashes between symbols
exported by different modules isn't permitted, so every module's boot
function has to be named differently, so we need to know the module's
internal name in order to call any code in it.  Loading under a different
name just won't work on that kind of system (as I mentioned upthread).

We're stuck with this external naming in many respects, at least until we
start putting dependency-type information in the module files themselves,
in a form that can be read without doing a dlopen().  This is something
I've considered before, but not implemented because of concerns about
what various dynamic linkers might accept.  But if we could do it, we
could include in this metadata the name of the module's boot function,
making it possible to load a module under any name on any system.

If we can relax the connection between modules' internal names and disk
names in this way, it would then be feasible to introduce a distinction
between the module file and the logical modules in contains.  We already
have a special-case relaxation of the one-to-one correspondence --
modules linked in to the main executable -- and I can see advantages in
fully generalising it.

-zefram


  reply	other threads:[~2000-09-10 21:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-09 17:20 Bart Schaefer
2000-09-10 21:16 ` Peter Stephenson
2000-09-10 21:35   ` Zefram [this message]
2000-09-10 22:29     ` Bart Schaefer
2000-09-14 15:18       ` Andrej Borsenkow
2000-09-14 16:36         ` Bart Schaefer
2000-09-14 17:15           ` Andrej Borsenkow
2000-09-15 18:14           ` Andrej Borsenkow

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=E13YEke-0007UG-00@crucigera.fysh.org \
    --to=zefram@fysh.org \
    --cc=pws@pwstephenson.fsnet.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).