unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: syntax-local-binding
Date: Mon, 23 Jan 2012 16:03:34 -0500	[thread overview]
Message-ID: <87hazmrv15.fsf@netris.org> (raw)
In-Reply-To: <871uqqpfoo.fsf@pobox.com> (Andy Wingo's message of "Mon, 23 Jan 2012 17:05:43 +0100")

Andy Wingo <wingo@pobox.com> writes:

> On Fri 20 Jan 2012 23:03, Mark H Weaver <mhw@netris.org> writes:
>
>>   (let ((x 1))
>>     (syntax-local-binding #'x))
>>
>> is not equivalent to:
>>
>>   (let ((x 1))
>>     (local-eval '(syntax-local-binding #'x) (the-environment)))
>
> Indeed; bummer!  I think, though, that this is simply a consequence of
> giving more power to macro writers.
>
> It is analogous in some ways to the changes that identifier-syntax
> introduce into macro writing: with identifier-syntax, one can no longer
> write a code walker with syntax-rules pattern matching, as single
> identifiers may expand out to complicated expressions, possibly even
> with side effects.

This is false.  Macros are always expanded _before_ any of their
arguments are expanded.  Therefore, a code walker sees the unexpanded
forms, including any "simulated variables" bound by identifier-syntax.

>>> Why do you think that?  The procedures do carry metadata; I understood
>>> that that was your strategy, to use the serialization of the
>>> syntax-rules form in the procedure metadata.
>>
>> Well, this was in the context of a new strategy where psyntax would
>> include a new core form called `call-with-current-local-expander' that
>> calls its parameter (a procedure or macro) with a procedure that accepts
>> an expression and returns an expanded form.  In this case, the most
>> straightforward implementation would simply serialize the (r w mod)
>> structures directly.
>>
>> Toward that end, I was thinking it would be nice to keep those
>> structures serializable.  The only part that's not currently
>> serializable are the transformer procedures for local macros.
>> Thus the change in representation.
>
> I have been staring at this empty page here for a little while, writing
> and re-writing, but I can't get over a feeling that I really don't want
> this kind of work in psyntax itself.

Your priorities are reversed from what they ought to be.

What you _should_ be worried about is making commitments in our API that
we must continue to support forever.  This is a _real_ problem, since it
constrains our ability to modify our implementation in the future.

Putting the `the-environment' in psyntax is, at worst, a stylistic
issue.  Whether it belongs there is a matter of taste, but however
strongly you may feel about that, it is a purely _internal_
implementation issue.  The really important thing is that it commits us
to _nothing_.  There's nothing stopping us from radically reimplementing
it later.  In particular, there's nothing stopping us from moving it out
of psyntax later.

Guile has been in existence for a couple of decades already, and I hope
that it will be actively used for many decades to come.  With that in
mind, please consider the long view.  One of the reasons Scheme has
lasted so long is because it tries exceptionally hard to hide internal
implementation details.  Implementations that expose too much internal
detail may derive a short-term benefit from doing so, but it comes at
the price of eventual calcification: there comes a time when
implementations that expose too much become unable to make significant
internal structural changes.

Please consider this.  I feel that your mind has become closed to my
arguments.

     Mark



  reply	other threads:[~2012-01-23 21:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 17:00 syntax-local-binding Andy Wingo
2012-01-15 17:22 ` syntax-local-binding Andy Wingo
2012-01-19 11:41   ` syntax-local-binding Andy Wingo
2012-01-20 20:26     ` syntax-local-binding Mark H Weaver
2012-01-20 21:23       ` syntax-local-binding Andy Wingo
2012-01-20 22:03         ` syntax-local-binding Mark H Weaver
2012-01-22  0:03           ` syntax-local-binding Ludovic Courtès
2012-01-23 16:05           ` syntax-local-binding Andy Wingo
2012-01-23 21:03             ` Mark H Weaver [this message]
2012-01-23 22:19               ` syntax-local-binding Andy Wingo
2012-01-24  2:11                 ` syntax-local-binding Mark H Weaver
2012-01-24 11:42                   ` syntax-local-binding Andy Wingo
2012-01-24 17:29                     ` syntax-local-binding Noah Lavine
2012-01-24 10:30                 ` syntax-local-binding Peter TB Brett
2012-01-24 10:38                   ` syntax-local-binding David Kastrup
2012-01-24 11:26                   ` syntax-local-binding Andy Wingo
2012-01-24 13:25                     ` syntax-local-binding Mark H Weaver
2012-01-24 20:28                       ` mark uniqueness (Was: Re: syntax-local-binding) Andy Wingo
2012-01-25  0:26                         ` mark uniqueness Mark H Weaver
2012-01-25  9:02                           ` Andy Wingo
2012-01-24 21:22                       ` syntax-local-binding Andy Wingo
2012-01-25  2:30                         ` syntax-local-binding Mark H Weaver
2012-01-25  7:49                           ` syntax-local-binding Stefan Israelsson Tampe
2012-01-25 11:18                           ` syntax-local-binding Andy Wingo
2012-01-25 13:18                           ` syntax-local-binding Ludovic Courtès
2012-01-25 18:08                             ` syntax-local-binding Mark H Weaver
2012-01-26 11:21                             ` syntax-local-binding Andy Wingo

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=87hazmrv15.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).