From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: guile-log getting a new stack Date: Sun, 14 Apr 2013 23:07:23 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1365973653 24416 80.91.229.3 (14 Apr 2013 21:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2013 21:07:33 +0000 (UTC) To: guile-user@gnu.org, guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 14 23:07:37 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URU9A-0000CS-Gt for guile-devel@m.gmane.org; Sun, 14 Apr 2013 23:07:36 +0200 Original-Received: from localhost ([::1]:56743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URU99-00084I-Tz for guile-devel@m.gmane.org; Sun, 14 Apr 2013 17:07:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URU94-0007yg-St for guile-devel@gnu.org; Sun, 14 Apr 2013 17:07:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URU93-0007mN-Ln for guile-devel@gnu.org; Sun, 14 Apr 2013 17:07:30 -0400 Original-Received: from mail-pb0-f45.google.com ([209.85.160.45]:57389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URU8y-0007le-WB; Sun, 14 Apr 2013 17:07:25 -0400 Original-Received: by mail-pb0-f45.google.com with SMTP id ro12so2171685pbb.32 for ; Sun, 14 Apr 2013 14:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=4l6F+zN4Js04VgXMTz8/kDBIzhj1KFj9igV4aGB4Oy4=; b=jJh7z+0lh4+SlALSHT8/mBTtiR6obPH1029InGWFwJNgPX3L4APf3ndR5P6zWwNLzi aDdNOrE0sbZ3S6pcREOuGQo3LUschYgHqcCFWZFkHxNK5Vw+ogFsEd1Li6CAImxAR+5k QPMI1xAFQ6yroksLa3KL4adnYt+y8f2UqXsoZgYzCp7bSA9zRyhLQ5TZ0RwrM9Ol9zT2 2fWhamLTvtm6CIeSlPI/pt2j/mD8GkFPgFMsEXT25NpGZhFhxWm8CsNt/HBEqKeL2OKC PhsQYcKwVWqbQzf78lkY9HzQMrw/MLV13sem7CcyXNp544OgJQwMJhaG8wIF8maNroOv CY9Q== X-Received: by 10.67.3.35 with SMTP id bt3mr2898452pad.157.1365973643649; Sun, 14 Apr 2013 14:07:23 -0700 (PDT) Original-Received: by 10.70.22.5 with HTTP; Sun, 14 Apr 2013 14:07:23 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.45 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16243 gmane.lisp.guile.user:10259 Archived-At: 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