From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chaos Eternal Newsgroups: gmane.lisp.guile.devel Subject: discussion: serialize procedures and continuations Date: Thu, 15 Aug 2013 21:47:52 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1376574493 29140 80.91.229.3 (15 Aug 2013 13:48:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Aug 2013 13:48:13 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Aug 15 15:48:13 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 1V9xuN-0001c0-OF for guile-devel@m.gmane.org; Thu, 15 Aug 2013 15:48:11 +0200 Original-Received: from localhost ([::1]:53453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9xuN-0003B2-5U for guile-devel@m.gmane.org; Thu, 15 Aug 2013 09:48:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9xuC-00037R-S0 for guile-devel@gnu.org; Thu, 15 Aug 2013 09:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9xu6-0000wu-RI for guile-devel@gnu.org; Thu, 15 Aug 2013 09:48:00 -0400 Original-Received: from mail-bk0-f46.google.com ([209.85.214.46]:57064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9xu6-0000wU-L1 for guile-devel@gnu.org; Thu, 15 Aug 2013 09:47:54 -0400 Original-Received: by mail-bk0-f46.google.com with SMTP id 6so229629bkj.5 for ; Thu, 15 Aug 2013 06:47:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=Wab2QJKPQ0zK7OecBHL3ga21DpyzzsH5CmxLP1j7vuI=; b=Eb95qvn47S9owagjvlxV6K5e9UDE04CflgoKVUDRMK/gDBs55V9c2Px738akWcnR6q 2vg5KY3KtilOKObao2+/+YsXxHtq2vQuw7APHyk2BrSvd6lJbeoWkbgywAD/+AWtxXdm s5PkrmWFy2kU1CDCoVsXoacM/RYwiKh2t+o/yOPJyeDxMUdb7EVngKjJT77TSNs8Tj7o Vf5e9aMo5doMONWZSTjBZ4vD0Gbl7PEeoCzLXRo3qVgYXIZchqYu4HQViECdQEp4C7vu jxhYxfqXF6yvVVOOXiA4vj85HLJOUXVOtAo+c5zGOPg6N/Hf5TTPW0JKO31T69OcOhWo QIyw== X-Gm-Message-State: ALoCoQkARpFoA1vMw8euYeGeTj5R9pz77uxAT9tl0pIdYQVHxS7jOpIbiSIecWeq4GFVgtOPEy6K X-Received: by 10.204.224.77 with SMTP id in13mr2035864bkb.24.1376574472887; Thu, 15 Aug 2013 06:47:52 -0700 (PDT) Original-Received: by 10.204.71.206 with HTTP; Thu, 15 Aug 2013 06:47:52 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.214.46 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:16559 Archived-At: In Scheme, procedures are closures, that means it has the code of the procedure itself as well as the required environment for running that procedure. And, mostly, continuations are considered closure. Hence, it is reasonable to expect a way to serialize the closures to disks and/or remote machines over network. Usage: Stored procedures can be restored later or restored remotely which makes remote procedure call more easier. Problems are when these procedures contain reference to object outside the scheme, say, opened fds, acquired locks/mutexes these objects will lost. But hooks can be added to overcome these problems. Stored continuations can restored later to make program continue to running after system failure, or, in web application, can be used to finish a user transaction. also, stored continuations can be transferred to remote hosts to make process-migration. still hooks are needed when programmer need to deal with opened files and so on. existing implementations: Gambit-C: the termite module of gambit-c heavily depends on serializable closures to have functions like remote process call, process migration and remote spawn. chicken: chicken has termite port and also has these function implemented. I am porting termite to guile. that's why I am interesting in this.