From: Mikael Djurfeldt <mdj@kvast.blakulla.net>
Cc: djurfeldt@nada.kth.se, guile-devel@gnu.org
Subject: Re: goops and memoization
Date: Wed, 04 Dec 2002 03:41:27 +0100 [thread overview]
Message-ID: <xy7el8ywlns.fsf@linnaeus.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <02120312173604.12810@locke.free-expression.org> (Lynn Winebarger's message of "Tue, 3 Dec 2002 12:17:36 -0500")
Lynn Winebarger <owinebar@free-expression.org> writes:
> On Tuesday 03 December 2002 02:59, Mikael Djurfeldt wrote:
>> Well, actually we have a guarantee that when we re-memoize, 'lambda,
>> 'if etc are bound to exactly the same thing as when the procedure was
>> originally memoized. This is because the lexical environment of the
>> method is used when re-memoizing.
>
> Either define-syntax or define can change the meaning of
> lambda in the global environment. It will use the same binding,
> true, but that's not the same thing.
Since procedure-source operates on a closure, I already know for sure
what kind of "lambda" created it. As for other mentions of lambda,
procedure-environment will tell me what they mean.
> The memoizer is not an optimizer. It merely expands macros
> into a constant core representation. I fail to understand the
> problem.
Problem 1: The optimizer gets dependent upon the memoized
representation.
[The goops dependencies that Dirk mention are really minor (except
for the current lack of an abstraction barrier towards the
environment) and can be adjusted quickly if things changes.]
Problem 2: Working on the memoized representation prevents writing
optimizations in Scheme.
>> Thus, we have the requirement that memoization is semantically 100%
>> reversible. Then one might of course argue that that is a too strict
>> requirement.
>
> Requiring reversibility of arbitrary macro expansions is pretty
> close to nuts.
Reversibility of macro expansions is not required. The optimizer in
fact works better if all macros already are expanded.
>> The original reason for the choice to work on Scheme code instead of
>> on the memoized representation was that it was simpler and could be
>> handled on the Scheme level, and could be made to work quickly.
>
> If you do it at the scheme level, sure. But if you're doing it at the
> C level you have to use some system-specific representation anyway.
> So what's wrong with constants?
Nothing except for problems 1 and 2 above.
(Clarification regarding problem 1: The "system-specific
representation" you talk about is not likely to change and trivial to
modify if a change should occur while large parts of the optimizer
might need to be rewritten if the memoized representation changes.
Consider, for example, that the tree structure of IM_DO is different
from that of "do" and it's quite easy to imagine quite a lot stranger
representations.)
Best regards,
Mikael
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-12-04 2:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.GSO.4.05.10212011757340.18607-100000@sallust.ida.ing.tu-bs.de>
2002-12-01 18:00 ` goops and memoization Neil Jerram
2002-12-02 8:45 ` Mikael Djurfeldt
2002-12-02 9:14 ` Mikael Djurfeldt
2002-12-03 0:13 ` Lynn Winebarger
2002-12-03 7:59 ` Mikael Djurfeldt
2002-12-03 8:38 ` Tom Lord
2002-12-04 2:25 ` Mikael Djurfeldt
2002-12-04 2:49 ` Tom Lord
2002-12-03 17:17 ` Lynn Winebarger
2002-12-04 2:41 ` Mikael Djurfeldt [this message]
[not found] <Pine.GSO.4.05.10212021836430.21423-100000@sallust.ida.ing.tu-bs.de>
2002-12-04 2:19 ` Mikael Djurfeldt
[not found] <Pine.GSO.4.05.10212021650410.21423-100000@sallust.ida.ing.tu-bs.de>
2002-12-04 1:53 ` Mikael Djurfeldt
2002-12-04 2:38 ` Tom Lord
2002-12-04 2:56 ` Rob Browning
2002-11-16 13:41 Dirk Herrmann
2002-11-17 10:56 ` Neil Jerram
2002-11-20 18:11 ` Dirk Herrmann
2002-11-21 3:11 ` Mikael Djurfeldt
2002-11-21 3:28 ` Mikael Djurfeldt
2002-11-21 23:50 ` Neil Jerram
2002-11-22 1:08 ` Mikael Djurfeldt
2002-11-22 1:13 ` Mikael Djurfeldt
2002-11-24 9:41 ` Neil Jerram
2002-11-24 16:32 ` Mikael Djurfeldt
2002-11-21 20:31 ` Neil Jerram
2002-11-22 0:49 ` Mikael Djurfeldt
2002-11-29 22:48 ` Neil Jerram
2002-11-29 23:31 ` Neil Jerram
2002-11-21 20:36 ` Neil Jerram
2002-11-24 16:42 ` Dirk Herrmann
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=xy7el8ywlns.fsf@linnaeus.i-did-not-set--mail-host-address--so-tickle-me \
--to=mdj@kvast.blakulla.net \
--cc=djurfeldt@nada.kth.se \
--cc=guile-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.
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).