From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: problems with export and :cache Date: Sun, 01 Nov 2015 23:56:49 +0100 Message-ID: <87io5ll45q.fsf@nicolasgoaziou.fr> References: <87vb9pyf0l.fsf@gmail.com> <87oafhoby4.fsf@nicolasgoaziou.fr> <877fm5xzpm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt1Wr-0000le-EK for emacs-orgmode@gnu.org; Sun, 01 Nov 2015 17:55:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zt1Wq-0004m2-8I for emacs-orgmode@gnu.org; Sun, 01 Nov 2015 17:55:13 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:58842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt1Wq-0004lq-1i for emacs-orgmode@gnu.org; Sun, 01 Nov 2015 17:55:12 -0500 In-Reply-To: <877fm5xzpm.fsf@gmail.com> (Aaron Ecay's message of "Thu, 29 Oct 2015 19:05:25 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org Hello, Aaron Ecay writes: > If this means =E2=80=9Ccan it ever work?=E2=80=9D then I think the answer= is =E2=80=9Cyes it > can=E2=80=9D. But I think the current implementation is broken and likel= y to > remain so for the foreseeable future. The issues are: > > 1. :cache only works for code which is a pure function of its header args > 2. When combined with :session, the environment that the code is evaluated > in is not created anew each time it is run. This makes it much easier > to leak references to (e.g.) variables defined in other blocks > 3. The proper notion of purity is not easily defined when the code does > things like modifying the emacs environment, touching the filesystem, > or accessing the language=E2=80=99s RNG. > 4. We (org devs) don=E2=80=99t actually understand how the semantics of c= ache > interacts with other babel features. See: > . > > 1-3 are likely to be extremely confusing for users, especially less > technically sophisticated ones (what=E2=80=99s a =E2=80=9Cpure function= =E2=80=9D anyway)? The > inability to give a clear introductory explanation of the feature in > combination with 4 indicating we don=E2=80=99t actually understand it our= selves > makes me feel like we should not be advertising, let alone recommending, > it. > > The only other literate programming environment that I know of that > implements such a feature is knitr (for R). They address these issues > by providing (optional) free-variable analysis to construct a dependency > graph between code blocks. There is also some handling of RNG seed > values. The documentation is much > more comprehensive, including a prominent statement about the dangers of > side effect-ful code and a nuanced discussion of several issues, > including the RNG. Thank you for the explanations. Assuming the user knows what s?he is doing (so I'm not bothered by issues 2 and 3), :cache is still a somewhat useful feature. I don't mind advertising it. Though, I agree we could include big fat warnings about it in the manual. Also, :cache might be a bit misleading as it implies more than what this feature offer, i.e., a dumb "don't update results if contents didn't change". I cannot think of a better name, tho. Regards, --=20 Nicolas Goaziou