unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
Cc: guile-devel@gnu.org
Subject: Re: memoization and conditional defines
Date: Thu, 07 Nov 2002 21:11:17 -0600	[thread overview]
Message-ID: <87vg387o2y.fsf@raven.i.defaultvalue.org> (raw)
In-Reply-To: <Pine.GSO.4.05.10211071839250.18458-100000@sallust.ida.ing.tu-bs.de> (Dirk Herrmann's message of "Thu, 7 Nov 2002 18:52:28 +0100 (CET)")

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

> But: How should a memoizer that is performed _before_ execution know what
> will be correct?  How should it know whether there will be a binding for
> '=>?

It seems like it can't in that case.

I'm not entirely clear on the issues involved here, but I'd like to
be, so please bear with me.  Would it be possible (and make any sense)
to arrange for something like like "just in time" memoization for
top-level forms (as I think Clinton may have suggested), or would that
overly complicate the code?  i.e. don't memoize top-level expressions
until you're ready to execute them.  Such an approach might prevent
those bits from being compiled efficiently, but I suppose the user
could choose whether or not to write things that way.

There's still the question of whether or not we should even allow
non-top-level defines like this, although I can understand the
impulse, esp for configuration related decisions.  I'd say if
supporting them leads to really nasty semantic or implementational
complexities, especially if given suitable alternatives, then perhaps
we shouldn't.

Also, would eval-when based defines still be OK?  I would presume so,
since they're essentially a conditionally included "begin block".

  (eval-when (compile)
    (define => bar))

>  a) be incompatible with R5RS.  This will, however, require us to make it
>     clear for users of guile where and how we deviate from R5RS.  Taking
>     this option will also imply that our macros are not really hygienic.
>     It also means that an interpreted system will behave different than a
>     compiled or memoized system, even if there are no uses of eval or
>     load.

Hope we can avoid that one.

>  b) complicate the memoization process in order to get things right.  An
>     option that we have here is the following:  Top-level forms are not
>     memoized but interpreted.  Memoization is only done whenever a
>     non-top-level scope is entered, like a let-form, or a
>     lambda-expression. The cost of this solution is that in addition to
>     the memoizer and the executor we would need an interpreter.

Why are let forms and lambda expressions excluded?

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu


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


  parent reply	other threads:[~2002-11-08  3:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-07 17:52 memoization and conditional defines Dirk Herrmann
2002-11-07 19:08 ` Bruce Korb
2002-11-07 20:54   ` Clinton Ebadi
2002-11-07 23:22   ` Lynn Winebarger
2002-11-08  0:46     ` Bruce Korb
2002-11-08  1:24       ` Lynn Winebarger
2002-11-09  8:19         ` Dirk Herrmann
2002-11-09 22:39           ` Bruce Korb
2002-11-08  3:11 ` Rob Browning [this message]
2002-11-09  9:00   ` Dirk Herrmann
2002-11-09  9:41     ` tomas
2002-11-09 17:08     ` Rob Browning
2002-11-17 20:41 ` Marius Vollmer
2002-11-17 21:42   ` Bruce Korb

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=87vg387o2y.fsf@raven.i.defaultvalue.org \
    --to=rlb@defaultvalue.org \
    --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).