From: Andrea Corallo <akrl@sdf.org>
To: Daniel Colascione <dancol@dancol.org>
Cc: emacs-devel@gnu.org
Subject: Re: A prototype for a binding based approach to proper namespaces
Date: Sat, 09 May 2020 08:05:24 +0000 [thread overview]
Message-ID: <xjfblmxpm7v.fsf@sdf.org> (raw)
In-Reply-To: <E1jXCef-0007uy-Lm@dancol.org> (Daniel Colascione's message of "Fri, 08 May 2020 16:43:43 -0700")
Daniel Colascione <dancol@dancol.org> writes:
> On May 8, 2020 1:49:05 PM Andrea Corallo <akrl@sdf.org> wrote:
>
>> Hi all,
>>
>> given the ongoing discussion on namespaces I thought was interesting to
>> try out a prototype to reason on.
>>
>> I wrote a short page explaining what I did and how it is implemented:
>>
>> https://akrl.sdf.org/lexspaces/lexspaces.html
>>
>> It's a quick hack, certainly many pieces are missing, is potentially a
>> very bad idea, but I'd be interested in opinions.
>
> If the set of imports is known at compile time, why do we need to pay
> the runtime cost of the binding?
I think it depends on how resilient you want to have your language to
redefinitions. Say you have four libraries B derived from A and C from
B etc:
A <= B <= C <= E
E has visibility on ~everything was defined in A. Now what if while
running A changes the value of something used by E? We need at least
one indirection to handle that otherwise you would be pointing still to
the original object. But it is more complex because while running B
could decide to unimport the definition from A and define the variable
locally, then you need to retain the whole chain to have a consistent
behavior.
Now, I think when compiling would a fair assumtion that libraries (B and
C here) never unimport and redefine variables or functions. With this
assumptoon should be very easy to compile out all intermediate
indirections (bindings) except the last 'effective' one.
> If we adopt the short prefix alias
> approach proposed elsewhere, we don't have the problem of bare symbol
> aliasing.
I'd like to add an optional prefix to `lexspace-import-symbol' but I'm
not sure we are on the same point here. Do you have the link for the
proposition you refer to? I've got a bit lost in all the discussion.
Andrea
--
akrl@sdf.org
next prev parent reply other threads:[~2020-05-09 8:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 20:47 A prototype for a binding based approach to proper namespaces Andrea Corallo
2020-05-08 23:43 ` Daniel Colascione
2020-05-09 8:05 ` Andrea Corallo [this message]
2020-05-09 15:16 ` Daniel Colascione
2020-05-09 15:50 ` Andrea Corallo
2020-05-09 15:56 ` Daniel Colascione
2020-05-09 16:39 ` Andrea Corallo
2020-05-09 16:41 ` Daniel Colascione
2020-05-09 17:15 ` Andrea Corallo
2020-05-09 17:17 ` Daniel Colascione
2020-05-09 23:14 ` Andrea Corallo
2020-05-09 23:46 ` João Távora
2020-05-09 23:29 ` Vladimir Sedach
2020-05-09 23:53 ` João Távora
2020-05-10 0:12 ` Daniel Colascione
2020-05-10 4:18 ` Vladimir Sedach
2020-05-10 15:24 ` Andrea Corallo
2020-05-10 17:46 ` Vladimir Sedach
2020-05-10 20:14 ` Andrea Corallo
2020-05-09 7:38 ` Helmut Eller
2020-05-09 8:27 ` Andrea Corallo
2020-05-09 8:50 ` Helmut Eller
2020-05-09 10:57 ` Andrea Corallo
2020-05-09 16:09 ` Dmitry Gutov
2020-05-09 18:08 ` Helmut Eller
2020-05-09 18:55 ` Dmitry Gutov
2020-05-09 22:52 ` Vladimir Sedach
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=xjfblmxpm7v.fsf@sdf.org \
--to=akrl@sdf.org \
--cc=dancol@dancol.org \
--cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.