From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: redo-safe-variables and redo-safe-parameters Date: Mon, 1 Apr 2013 09:37:08 +0800 Message-ID: References: <13378334.Jv25yq6OaM@warperdoze> <3730715.JXDxfz33sS@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1364780233 9027 80.91.229.3 (1 Apr 2013 01:37:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Apr 2013 01:37:13 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 01 03:37:40 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 1UMTgp-0007vX-UM for guile-devel@m.gmane.org; Mon, 01 Apr 2013 03:37:40 +0200 Original-Received: from localhost ([::1]:42570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMTgR-0004lZ-ED for guile-devel@m.gmane.org; Sun, 31 Mar 2013 21:37:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMTgN-0004lH-4F for guile-devel@gnu.org; Sun, 31 Mar 2013 21:37:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMTgL-0004GU-Dp for guile-devel@gnu.org; Sun, 31 Mar 2013 21:37:11 -0400 Original-Received: from mail-ia0-x22f.google.com ([2607:f8b0:4001:c02::22f]:64874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMTgL-0004GQ-82 for guile-devel@gnu.org; Sun, 31 Mar 2013 21:37:09 -0400 Original-Received: by mail-ia0-f175.google.com with SMTP id y26so1531808iab.20 for ; Sun, 31 Mar 2013 18:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=jSaC09H2hjHj6ujsuQzcyGOU4GHDX++Bb8q1ahWyWy4=; b=i5KaGw+BETerwqAm5dK9g4UHn0TBnqBktGH96Ny5XkZtG3DrwyxWiGihDHXt4zTLRL uM8ee8lsijKt4mmEE4Y/eVehvcEOdS3YmLIw6CXXjBOwiJH4MM9k0Jr6FezQQP75VaVM 8ZV+du/PpF0GXx17fcMJMMrkC7OCyqzE4+5VcNTyMjeu5uQmoQIZMiDrzglcU6CGkYf+ PMxx4w/MBymFQpxHTbrDMyU7DBjQIpaRTaigM07MEK2nku/8396UNifwRNE/GSXthKYx H3bRUTg3lE8309V2pjVo2EOII/v0Y5BZT22v/szP/QrQtGcqa9U/Sz8OX7P82Oq7W1C7 olmw== X-Received: by 10.50.135.105 with SMTP id pr9mr2837567igb.6.1364780228731; Sun, 31 Mar 2013 18:37:08 -0700 (PDT) Original-Received: by 10.64.26.168 with HTTP; Sun, 31 Mar 2013 18:37:08 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::22f 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:16077 Archived-At: On 1 April 2013 05:16, Stefan Israelsson Tampe wrote: > Note two things > * it's better to pile up the redo-safe-variables with a parameter > then the clumsy version in the previous mail which will not work well. > > * A continuation that backtracks from down the stack back to the creation of the > continuation needs to restore the variable in order for redo and undo to > be correct. This means that dynamic wind should be skiped for redo > safe variables. > > e.g. you need to guard the state booth upwards and downwards. The reason to > do this is that if we want to consider non-boxed variables that we > local-set as an > optimization for undo safe variables we need to add this complexity > Dynamic states are not suitable for the purpose. They have nothing to do with compenstating for the inability of continuations to backtrack _through side-effects_. I believe this will be obvious if you consider the problem of side-effects generally, rather than focusing only on variable assignment. Backtracking is typically handled (at least, in part) by the evaluator, by either: - explicitly tracking side-effects, so that they can be reverted in a sensible manner; or - state-copying, that is, non-mutable environments. Of course, in the absence of side-effects backtracking can be trivially handled by continuations. It seems you hope to abuse dynamic states to avoid explicitly tracking the side-effects and the result is quite a mess. I do not see how you can hope to marry the concepts of continuations and backtracking side-effects without modifying the evaluator, at which point you have continuations and an evaluation environment that is not Scheme, although perhaps very Scheme-like. It seems your real objective is to extend Scheme-embedded logic DSLs by supporting continuations and non-functional Scheme code within them. I appreciate that you have some experience in the area, can you point to any papers that discuss anything similar to what you are trying to achieve? (Not the Scheme modifications, but the logic DSL + side-effects + continuations). Back to the Scheme modifications. Perhaps I do not understand that problem space as well as you, but when I look at this I see a premature attempt to solve a problem that is _hard_. There is also no precedent for continuations that backtrack side-effects in any Scheme or Lisp I know of, and noone will miss that if you do not acheive it. Clearly you are spending some effort on this, and I do not like to see anyone wasting efforts. IMO this specific path is unproductive. Regards