unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mikael Djurfeldt <mdj@kvast.blakulla.net>
Cc: djurfeldt@nada.kth.se,  Neil Jerram <neil@ossau.uklinux.net>,
	guile-devel@gnu.org
Subject: Re: goops and memoization
Date: Wed, 04 Dec 2002 03:19:21 +0100	[thread overview]
Message-ID: <xy7k7iqwmom.fsf@linnaeus.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <Pine.GSO.4.05.10212021836430.21423-100000@sallust.ida.ing.tu-bs.de> (Dirk Herrmann's message of "Tue, 3 Dec 2002 22:39:01 +0100 (CET)")

Dirk Herrmann <dirk@sallust.ida.ing.tu-bs.de> writes:

> As stated in my previous mail the output of procedure-source is not the
> full scheme code that is necessary to re-memoize the code:
>   guile> (define foo (let ((bar 1)) (lambda () bar)))
>   guile> (procedure-source foo)
>   --> (lambda () bar)
> That is, trying to re-translate this output is not as clean a separation
> as you claim.  You depend on the fact that during execution there is
> sufficient information available to reliably re-compile any code such that
> it fits into the rest of the compiled code around it.  That is a strong
> assumption and it may prove to be expensive to guarantee it.

Could you explain this to me?  Why is it such a strong assumption?

My obvious counter example is:

(define foo2 (local-eval (procedure-source foo) (procedure-environment foo)))
(foo2) --> 1

[There is a need here to treat the first `lambda' specially, but
 that is a trivial problem.]

Which do you think puts the heavier constraint, procedure-source or
procedure-environment?  Note that there is no assumption needed that
procedure-source returns the verbatim source expression from which the
closure was created.  And an environment is simply a mapping of
variables to bindings.

Note that there is nothing "around" the method into which it should
fit.  The method has it's own closed environment.
  
> I had not actually planned to work on goops itself, and I will try
> to avoid doing so if possible - my resources are limited.  If we can
> agree on one way to go, I would prefer if I would not have to modify
> goops myself.

That is fine.  Can you share your current source?

> To get around the current problems (which are only relevant in my private
> copy of guile - none of my changes are yet submitted) I have suggested to
> replace one kind of dependency between goops and the evaluator
> (compile-method relying on the possibility to re-compile the output of
> procedure-source) by another one (compile-method working directly on the
> memoized code).  You are suggesting a different way, namely to add an
> interface to allow memoization of re-compiled scheme code and re-insert
> this code into the rest of the memoized code, which is just another form
> of dependency.  My preferred long-term solution, to have optimization
> functions work on a post-syntax-expansion-pre-memoization intermediate
> format also gets rid of some dependencies and adds a dependency on the
> intermediate format.  Dependencies are acceptable if they are between
> parts of the code which are stable, which I hope the future and yet to be
> defined intermediate format to be.

Well, I may be dense, but

* You have still failed to show to me why the second alternative
  (working on Scheme source) introduces any kind of dependencies (given
  that we fix the "hole").  I'd really want you to try to convince me
  about that.

* I like your suggestion for long-term solution.  And,

* It's perfectly fine with me to re-implement compile-method in C,
  working on the memoized representation.

Best regards,
Mikael


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


       reply	other threads:[~2002-12-04  2:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.GSO.4.05.10212021836430.21423-100000@sallust.ida.ing.tu-bs.de>
2002-12-04  2:19 ` Mikael Djurfeldt [this message]
     [not found] <Pine.GSO.4.05.10212021650410.21423-100000@sallust.ida.ing.tu-bs.de>
2002-12-04  1:53 ` goops and memoization Mikael Djurfeldt
2002-12-04  2:38   ` Tom Lord
2002-12-04  2:56   ` Rob Browning
     [not found] <Pine.GSO.4.05.10212011757340.18607-100000@sallust.ida.ing.tu-bs.de>
2002-12-01 18:00 ` 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
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=xy7k7iqwmom.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 \
    --cc=neil@ossau.uklinux.net \
    /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).