From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: persistent data feature Date: Sun, 12 Dec 2021 13:43:57 +0800 Message-ID: <87a6h6xtr6.fsf@localhost> References: <87tufmjyai.fsf@gnus.org> <492F4AC1-2230-4D4C-9D8E-19659FBFB50B@mit.edu> <87bl1miivh.fsf@localhost> <2933756.8xI8jAGOd3@galex-713.eu> <5F4C874C-A38E-40EC-B56D-36B49AC058C8@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alexandre Garreau , "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 12 06:44:22 2021 Return-path: Envelope-to: ged-emacs-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 1mwHeo-0007Mi-8I for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Dec 2021 06:44:22 +0100 Original-Received: from localhost ([::1]:49040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwHem-0006of-SQ for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Dec 2021 00:44:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwHdF-0005r6-IN for emacs-devel@gnu.org; Sun, 12 Dec 2021 00:42:45 -0500 Original-Received: from [2a00:1450:4864:20::234] (port=45977 helo=mail-lj1-x234.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwHdB-0000Ri-D8 for emacs-devel@gnu.org; Sun, 12 Dec 2021 00:42:43 -0500 Original-Received: by mail-lj1-x234.google.com with SMTP id b19so17492287ljr.12 for ; Sat, 11 Dec 2021 21:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=cFYQn1UJpbWH6M4skvABfgplV0h378iqfP8Wc9mf3Qc=; b=UQZSXatSHWXqAuV0d29Qr18tWa2POUzGJGa2Nrjl6RN6LEYgmTf8Mt9VBnT8ggeEtm ScY9NQOb1so3rSQD+w7c4qKOKBl6NlihqTJMPdDYyMzjz2xvRU63OHB8bPmKn6JbZMIC /Q5rQdF8iOS6pwMfA+HkvDD9u55Sjj51wyXa4f8b6PMffS4vNqDBYJDb5d+pE+RF65XC rXAeWvcHS8qZ66wjzNEYTD7AE/V2QGGuQo+4llxttnJx0XNubRZnoT266IYgzwFU2IfS RLhKMoWMz/eua9xvQc1g/4w46I+AcOlWRjCw6O+JiAfMTDI1a0T1mxZfbg2DxOybVCjN LVhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=cFYQn1UJpbWH6M4skvABfgplV0h378iqfP8Wc9mf3Qc=; b=Sr4Hm+MYyUC2t1m0M5OhDGvAoefxnXDjvvQR9/q8m53HreiHNuuexoZ17ykYB+yiqi ETuzZJ0bgDs9MBfw4vbMLj8jBdyGeFZefvNFjbmNLykXO6HslT+WJDw+mjUGIkXMnTEv 6Zc8Jk3Lkyuj5XHPswAa1jiDwr5baSzBcU9gcfG4rFsYZw/q1KCecCEKYapDpko0TWqz liYDMp2PCvudkCFcggYTSXSrKgwJ9sBj9lC1FFnJtocKj7dwoxK9pBmeLuvWPw4SDHiS 8u4RYOibQeDc1pj4+a75FR3/DZQQ7uTAY1yZ1X7YZ5cggPGWsrx1PRks+JkbQAIr87kx ClNw== X-Gm-Message-State: AOAM533+CVcHgwFfkSUsvTFbFNaks/wrq2oipfdxe328Xm4XL1v1Ul6A V/zB7/a7ize944vPai9R76Y= X-Google-Smtp-Source: ABdhPJzn0WH9GBsDeHQtgMR3dC6fee4nYuLb51i+pEICFM1hXl2zpHZKg50A0LmoknVnxxe1frKIQA== X-Received: by 2002:a2e:1644:: with SMTP id 4mr21270085ljw.312.1639287755738; Sat, 11 Dec 2021 21:42:35 -0800 (PST) Original-Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id m29sm902502lfj.187.2021.12.11.21.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 21:42:35 -0800 (PST) In-Reply-To: <5F4C874C-A38E-40EC-B56D-36B49AC058C8@mit.edu> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::234 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=yantar92@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281757 Archived-At: Qiantan Hong writes: >> Doesn=E2=80=99t elisp=E2=80=99s printer detects cycles and print #0, #1,= etc. where=20 >> needed? > I think there=E2=80=99s some confusion here. > > My first =E2=80=9Cincremental=E2=80=9D has a specific meaning in =E2=80= =9Cincremental image=E2=80=9D, > it means dumping part of the Lisp heap, compared to =E2=80=9Cfull image= =E2=80=9D > which dump the whole heap. `prin1` can be viewed as a trivial > implementation of this, but usually this is done much more efficiently > by dumping out the memory representation directly. Thanks for the clarification! > I believe the =E2=80=9Cincremental=E2=80=9D Ihor means is to store increm= ental changes > to a data structure/object graph, as what I did in resist!.el for hash > tables. This is indeed hard to do in general. Either we need to > modify the Elisp VM to add hook that detect changes, or we > need to do graph edit distance algorithm on different snapshots > of objects. It probably doesn=E2=80=99t worth the effort. > > As what Ihor (I suppose) had in mind is incremental log operation, > prin1 is unrelated to this context because it prints out the whole object= graph. Yep. You are right. I was thinking about your resist!.el and also about textual representation of sqlite databases. Also, I had several cases when prin1 is not accurate on large circular objects generating un_read_able output or entering recursion deeper than max-specpdl-size. Incremental logging could be easier in this context. Best, Ihor