unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: 24102@debbugs.gnu.org, Glenn Michaels <gmichaels@Safe-mail.net>
Subject: bug#24102: Use guile variable objects as SRFI-111 boxes.
Date: Wed, 01 Mar 2017 09:51:29 +0100	[thread overview]
Message-ID: <87fuixjs6m.fsf@pobox.com> (raw)
In-Reply-To: <87wpixjoom.fsf@pobox.com> (Andy Wingo's message of "Wed, 31 Aug 2016 11:03:05 +0200")

On Wed 31 Aug 2016 11:03, Andy Wingo <wingo@pobox.com> writes:

> On Thu 18 Aug 2016 18:14, Mark H Weaver <mhw@netris.org> writes:
>
>> As I wrote above, the current guile compiler can already do this kind of
>> type inference, although it does not currently do this for boxes.
>> we can already anticipate having native code generation in the
>> next couple of years, and we must keep boxes semantically simple so that
>> our future compiler will be able to generate good code for this very
>> important fundamental type.
>
> For what it's worth, I don't see the optimization argument as weighing
> very heavily on this discussion.  I would rather have fewer fundamental
> data types rather than more, in the next two years or so.  I see the
> mid-term result here being that SRFI-111 boxes are much slower than
> variables.
>
> The highest performance compilation tier we can imagine would include
> adaptive optimization, and when it runs you can know that the variables
> that a bit of code uses are bound or not.  Also in that case we can
> reasonably make any call to variable-unset! deoptimize any code that
> uses variables, forcing it to reoptimize later.  Since variable-unset!
> is quite rare this is no big deal I think.

Following up here :)  So again I think the optimization argument is not
so important; if that were the only consideration then IMO the balance
of things would be that we should apply Glenn's patch.

There is a semantic consideration as well -- box-ref on a box created by
make-box should never throw an exception, and code that uses the
SRFI-111 should be able to rely on this.  We should probably not
introduce a gratuitous incompatibility here.  I propose to add a flag to
variables indicating that certain variables may not be unset.  We can
also consider reversing this, in that only variables with the flag can
be unset; my understanding is that the only user of variable-unset! is
the Elisp language on variables that it creates, so that would be
acceptable too.

Andy





      reply	other threads:[~2017-03-01  8:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  9:21 bug#24102: Use guile variable objects as SRFI-111 boxes Glenn Michaels
2016-08-02 10:25 ` Glenn Michaels
2016-08-04 20:59   ` Andy Wingo
2016-08-05  4:31 ` Mark H Weaver
2016-08-05  4:37   ` Mark H Weaver
2016-08-18 13:07 ` Glenn Michaels
2016-08-18 16:14   ` Mark H Weaver
2016-08-31  9:03     ` Andy Wingo
2017-03-01  8:51       ` Andy Wingo [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

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuixjs6m.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=24102@debbugs.gnu.org \
    --cc=gmichaels@Safe-mail.net \
    --cc=mhw@netris.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).