[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ideas for guile prolog
From: |
Andy Wingo |
Subject: |
Re: ideas for guile prolog |
Date: |
Sat, 28 Aug 2010 10:11:08 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Stefan,
On Wed 11 Aug 2010 14:35, Stefan Israelsson Tampe <address@hidden> 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/