DASH Shell discussions
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Cedric Blancher <cedric.blancher@googlemail.com>
Cc: dash@vger.kernel.org
Subject: Re: static vs. dynamic scoping
Date: Mon, 15 Nov 2010 14:45:07 -0700	[thread overview]
Message-ID: <4CE1A9E3.6080008@redhat.com> (raw)
In-Reply-To: <AANLkTinMbDZdL0LEt4Xq1SbFT_xWHoKJt9QNhw6Yk+u_@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

On 11/15/2010 02:11 PM, Cedric Blancher wrote:
> 
> Why is the debate static-vs-dynamic scoping coming up again?

Because before 'typeset' can be standardized in POSIX, we have to get
consensus from all the shell implementers that they will agree to
implement static scoping.

For ksh, the question is moot - ksh93 already does static only.

For dash, the question is valid - the current dash implementation is
dynamic only, but given that switching to static only could probably be
made more efficient, and dash values efficiency, it's a reasonable goal.

For bash and zsh, which currently are dynamic only, the problem stems
that there are now a number of shell script libraries for these two
shells that have exploited dynamic scoping, and which would break if we
aren't careful to standardize something that can still allow dynamic
scoping as an extension.  In other words, this was a probe of the
various shell implementers to figure out how easily static scoping can
be added on after the fact to a dynamic scoping implementation, so that
the shell could conform to a future POSIX revision that mandates static
and permits dynamic as an extension.

> With this background I doubt any proposal for dynamic scoping will
> make it into the next POSIX standard.

There's no desire for dynamic scoping in POSIX; David Korn has already
made that point clear on the Austin Group mailing list.  Rather, there
is a desire for minimal effort for complying with a new POSIX
requirement of static scoping on shells that currently lack it, as well
as backwards compatibility for shells that wish to continue to provide
dynamic scoping as an extension to the standard.

My take of the Austin Group list discussion is that the next revision of
the standard is most likely to have consensus if it just mandates
'typeset' for static scoping, and leaves 'local' as an implementation
extension for dynamic scoping.  Please, chime in on the Austin Group
conversation if you have something useful to add.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2010-11-15 21:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4CD9C280.60007@redhat.com>
     [not found] ` <4CDA6301.1010703@gmail.com>
2010-11-10 15:13   ` static vs. dynamic scoping Eric Blake
2010-11-15 21:11     ` Cedric Blancher
2010-11-15 21:45       ` Eric Blake [this message]
2010-11-10 14:15 ольга крыжановская
2010-11-10 21:01 ` Jilles Tjoelker
  -- strict thread matches above, loose matches on Subject: below --
2010-11-09 22:02 Eric Blake
2010-11-13 23:22 ` Harald van Dijk
2010-11-13 23:54   ` ольга крыжановская
2010-11-14  0:10     ` Harald van Dijk

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=4CE1A9E3.6080008@redhat.com \
    --to=eblake@redhat.com \
    --cc=cedric.blancher@googlemail.com \
    --cc=dash@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox