From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Terence Kelly Newsgroups: gmane.lisp.guile.devel Subject: persistent memory for Guile Date: Thu, 16 Mar 2023 03:02:27 -0400 (EDT) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5057"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (DEB 394 2020-01-19) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Mar 16 14:09:38 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcnMQ-00018C-IB for guile-devel@m.gmane-mx.org; Thu, 16 Mar 2023 14:09:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcnMC-0006uR-QG; Thu, 16 Mar 2023 09:09:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pchdK-0000nn-0x for guile-devel@gnu.org; Thu, 16 Mar 2023 03:02:42 -0400 Original-Received: from newman.eecs.umich.edu ([141.212.113.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pchdC-0002CK-MA for guile-devel@gnu.org; Thu, 16 Mar 2023 03:02:38 -0400 Original-Received: from email.eecs.umich.edu (email.eecs.umich.edu [141.212.113.99] (may be forged)) by newman.eecs.umich.edu (8.15.2/8.14.4) with ESMTPS id 32G72Rtx2721472 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 16 Mar 2023 03:02:27 -0400 Original-Received: from email.eecs.umich.edu (localhost [127.0.0.1]) by email.eecs.umich.edu (8.15.2/8.13.0) with ESMTP id 32G72RfZ2926355 for ; Thu, 16 Mar 2023 03:02:27 -0400 Original-Received: from localhost (tpkelly@localhost) by email.eecs.umich.edu (8.15.2/8.14.4/Submit) with ESMTP id 32G72RP22926351 for ; Thu, 16 Mar 2023 03:02:27 -0400 Received-SPF: pass client-ip=141.212.113.151; envelope-from=tpkelly@eecs.umich.edu; helo=newman.eecs.umich.edu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 16 Mar 2023 09:09:23 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21776 Archived-At: Dear Colleagues, An ongoing thread in the gnu-prog-discuss mailing list is discussing persistent memory for GNU projects. Circa late February, Jacob Bachmeyer suggested on that list that Guile might benefit from persistent memory. After consulting the Guile manual, I'm writing now to outline what this might mean and to invite interested persons in the Guile community to discuss further. First, a note on terminology: By "persistent memory" I do *not* mean newfangled non-volatile memory hardware, e.g., Intel Optane or NVDIMMs. Instead, "persistent memory" here refers to a purely software abstraction that can be implemented on conventional hardware --- ordinary computers with volatile DRAM memory and conventional block storage (HDDs, SSDs). The easiest way to vividly explain the possibilities for Guile might be to point out the persistent memory feature recently added to the GNU AWK (gawk) interpreter. The new persistent memory feature of gawk is called "pm-gawk." When you run an AWK script in the gawk interpreter, you may activate pm-gawk by specifying a file containing a persistent heap where pm-gawk will hold AWK variables and functions. AWK scripts themselves are *not* modified in any way to activate pm-gawk. A persistent heap lives in a file on disk and hangs around until deleted. It may be re-used by subsequent runs of the same AWK script or by completely different AWK scripts, i.e., it's a way to pass variables and functions between unrelated scripts. As a side effect, pm-gawk gives AWK (the moral equivalent of) a REPL. The Persistent Memory Gawk User Manual explains the details; see the Quick Start section for a succinct concrete illustration of use: https://www.gnu.org/software/gawk/manual/pm-gawk/ If Guile did something similar, the details might differ from pm-gawk, but the benefits would hopefully be the same: Efficient, transparent, and nearly effortless persistence-to-disk for arbitrary Scheme code, at the cost of small and fairly easy changes to Guile. Implementing pm-gawk was remarkably easy --- under 100 lines of code added/changed in the initial proof-of-concept prototype, most of which was integrating a malloc-compatible persistent memory library into the gawk interpreter: https://dl.acm.org/doi/pdf/10.1145/3534855 Another precedent for persistence in Scheme is a project that used an older persistent heap of mine to retrofit persistence onto a Scheme interpreter: https://github.com/tvcutsem/schemeken If you think that a similar persistence capability might be useful for Guile, let's talk. Thank you. Terence Kelly https://dl.acm.org/profile/81100523747