unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Stefan Israelsson Tampe <stefan.tampe@spray.se>
Cc: guile-devel@gnu.org
Subject: Re: ideas for guile prolog
Date: Sat, 28 Aug 2010 10:11:08 -0700	[thread overview]
Message-ID: <m3bp8m4q8j.fsf@unquote.localdomain> (raw)
In-Reply-To: <201008112335.56856.stefan.tampe@spray.se> (Stefan Israelsson Tampe's message of "Wed, 11 Aug 2010 23:35:56 +0200")

Hi Stefan,

On Wed 11 Aug 2010 14:35, Stefan Israelsson Tampe <stefan.tampe@spray.se> writes:

> The special thing with this situation is that you may fill up your entire Ram 
> with continuations so it would be nice to compact them tree wise and also 
> facilitate reasonable fast execution deducing the state before execution of a 
> closure. You essentially build a redo tree.

Some Schemes put stack frames on the heap, so that continuations that
"overlap" share state. Guile doesn't do this, but perhaps you could
simulate it by capturing continuations, and storing the stack of
continuations in a variable, or something. When continuations are
captured you could push on a new prompt, and then capturing a subsequent
continuation just captures the continuation up to the prompt.

You can simulate delimited call/cc with prompt/abort, except for
dynamic-wind effects (because aborting unwinds the stack). Guile 2.2
will have a properly delimited call/cc, preserving the dynamic state.

> This would allow for cool things like having a prolog system setting
> up a set of continuations that can be played with, generate new
> continuations etc.
>
> Any thoughts?

Sounds like fun :) Standard disclaimer that this wouldn't be ready for
Guile any time soon, but do have fun :)

Andy
-- 
http://wingolog.org/



      reply	other threads:[~2010-08-28 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11 21:35 ideas for guile prolog Stefan Israelsson Tampe
2010-08-28 17:11 ` 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=m3bp8m4q8j.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=stefan.tampe@spray.se \
    /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).