unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-user@gnu.org, guile-devel <guile-devel@gnu.org>
Subject: guile-log getting a new stack
Date: Sun, 14 Apr 2013 23:07:23 +0200	[thread overview]
Message-ID: <CAGua6m3Vbk-keWevAYb6JvG_abKK6n_h-CueCv1=kkBnDMyJmg@mail.gmail.com> (raw)

Hi all, I wanted to describe what my nearest effort in the guile-log
world will be targeted at.

First a small discussion of guile-log.

Guile-log is a macro system that originally was developed in order to
have a more schemish
macro system to model prolog program in. Kanren does not work here
because of it's lack of cut. Then with the system getting an efficient
continuation like feature for the stack the intereaving part of kanren
could be implemented and in guile-log there is an almost complete
kanren interface implemented ontop of guile-log. Then ontop of this is
the possibility to use traditionally stack based prolog like variables
as well as kanren like variables mixed or by itself (kanren varaibale
bindings sits on a functional assoc like structure passed
with the calculation). This combo is strictly more featureful in one
sense because with this we can have both dynwind like features and
kanren like features. To implement the interleaving part of kanren we
used a kind of variables which state was kept across unwind/rewind and
could at will store it's state so that it could later be retrieved. It
was dog slow though and added a quite significant overhead to the
interleaving operations.

So now I'm in the process to speed that system up, and the current
state is that I have it partly working.

What's remaining?
Well it boils down to this.
In order for the interleaving operations to work I need to reinstate
and save parts of the stack multiple times. Although this could be
mitigated to quite low overhead if we only use the kanren like
variables, the standard stack solution is not too bad either because
we assumed that the objects putting onto the stack and back on a tree
structure was not mutating and hence storage allocation could be
reused and almost no consing is needed. But with the new system
different
versions of the objects will be needed and this could invalidate the
tree structure in subtle and inefficient ways. The solution to this is
to maintain a separate stack structure for only these mutating objects
with the logic that we will do basically full copying when needed. So
this is what's next with guile-log to implement the mutating stack. A
new feature that will be added to this is real fluid-like objects.
Previously fluid-set! was not supported. And also an old feature that
was bitrotted will be restored e.g. the possibility to do breadth like
search algorithm via storage of state e.g. the code in postpone.scm.

If you are curious about guile-log you may find it at

   https://gitorious.org/gule-log

I do have some doc's in there and there are also some simple makefiles
to compile the nessesary C code. Probably you will need to murk the
Makefiles but's it's a no-jobb for a hacker :-)

Beware the state of that repo is a bit in fluid right now.

Comments are welcome.

/Stefan



                 reply	other threads:[~2013-04-14 21:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAGua6m3Vbk-keWevAYb6JvG_abKK6n_h-CueCv1=kkBnDMyJmg@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@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).