From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: stefan Newsgroups: gmane.lisp.guile.devel Subject: Re: unification Date: Fri, 14 May 2010 11:15:54 +0200 Message-ID: <201005141115.54210.stefan.tampe@spray.se> References: <201004121530.43030.stefan.tampe@spray.se> <87mxx74ldx.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273830932 24109 80.91.229.12 (14 May 2010 09:55:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 14 May 2010 09:55:32 +0000 (UTC) Cc: guile-devel@gnu.org To: Ludovic =?utf-8?q?Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 14 11:55:27 2010 connect(): No such file or directory Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OCrc6-0001vv-Ew for guile-devel@m.gmane.org; Fri, 14 May 2010 11:55:26 +0200 Original-Received: from localhost ([127.0.0.1]:55268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCrc5-0003XB-Tw for guile-devel@m.gmane.org; Fri, 14 May 2010 05:55:26 -0400 Original-Received: from [140.186.70.92] (port=42738 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCrbq-0003Uu-OV for guile-devel@gnu.org; Fri, 14 May 2010 05:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCrbp-0006Jw-NP for guile-devel@gnu.org; Fri, 14 May 2010 05:55:10 -0400 Original-Received: from spsmtp02oc.mail2world.com ([74.202.142.198]:3862) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCrbQ-0006HE-QO; Fri, 14 May 2010 05:54:45 -0400 Original-Received: from mail pickup service by spsmtp02oc.mail2world.com with Microsoft SMTPSVC; Fri, 14 May 2010 02:54:41 -0700 auth-sender: stefan.tampe@spray.se Original-Received: from 82.182.254.46 unverified ([82.182.254.46]) by spsmtp02oc.mail2world.com with Mail2World SMTP Server; Fri, 14 May 2010 02:54:39 -0700 User-Agent: KMail/1.12.4 (Linux/2.6.31.12-0.2-desktop; KDE/4.3.5; x86_64; ; ) In-Reply-To: <87mxx74ldx.fsf@gnu.org> X-OriginalArrivalTime: 14 May 2010 09:54:41.0029 (UTC) FILETIME=[78EBB350:01CAF34B] X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10329 Archived-At: I did a reference implementation of unification code in pure scheme. It is just 185 lines of code (the rest is the test case) see http://c-lambda.se/unify.scm Some timings for the example ============================ scheme-version > 2100 ms c-initial-guile > ~150 ms current-best-guile > 73 ms sbcl > 25 ms gprolog > ~20 ms So I've been able to tweak out 2x in guile + c So what next? This is what I will be playing with. one need apart from a unification primitive also be able to destruct a pattern into variable references this can be done in a vm on a stack machine. And I will now go on to let this vm be the guile vm itself. Later on when we the compiler starts to shine, I could hook into that as well and generate target code. So this litle play will spill over into being useful for the compiler later. /Stefan