From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>,
"guile-user@gnu.org" <guile-user@gnu.org>
Subject: persistant state in guile-log
Date: Wed, 27 Jan 2016 09:13:30 +0100 [thread overview]
Message-ID: <CAGua6m3-HoQs0hyPFEMhbWKhxgOKYdAhG+V=NgLRWCX0WeiM_A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]
Hi all,
In guile 2.1 the position of code segements are fixed relative certain
vectors and this makes it
possible to store indexes of code segements and as a possibility to persist
closures. I took advatage of this because state in guile-log means that we
must do exactly that. Persist not only datastructures like struct lists and
vectors vhashes etc, but also persist closures. So now one can do cool
things in guile-prolog like:
prolog> X=1,stall,Y=2.
prolog> .setp 1
prolog> .savep
prolog> .quit
stis> guile-prolog
prolog> .loadp
prolog> .refp 1
prolog> .cont
X=1
Y=2
prolog>
This is the interface:
---------------------------------------------------------------------
(.setp ) <key> associate current state to key
(.refp ) <key> instate state referenced by key to current state
(.savep ) save all referenced states to disk
(.loadp ) load new referenced states from disk
(.cont ) continue a stalled predicate from current state
I can make this persistant code into a library anyone interested?
Oh the security implications of this is horrible but I don't pretend that
guile-log is secure so
I don't care. What's more demading is that it depends on groveling into
guile internal datastructures. Therefore I am reqesting an official way of
persisting closures. What's your take on that? Would you
guy's want to supply such a mechansim or is it bad practice?
regards
Stefan
[-- Attachment #2: Type: text/html, Size: 2808 bytes --]
next reply other threads:[~2016-01-27 8:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 8:13 Stefan Israelsson Tampe [this message]
2016-01-27 8:51 ` persistant state in guile-log Andrew Gaylard
2016-01-27 11:32 ` Stefan Israelsson Tampe
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='CAGua6m3-HoQs0hyPFEMhbWKhxgOKYdAhG+V=NgLRWCX0WeiM_A@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).