From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Bug #25608 and the comment-cache branch Date: Sat, 4 Feb 2017 10:24:10 +0000 Message-ID: <20170204102410.GA2047@acm> References: <20170202202418.GA2505@acm> <83lgtouxpf.fsf@gnu.org> <20170202215154.GB2505@acm> <83h94bvhzw.fsf@gnu.org> <20170203172952.GC2250@acm> <0a40d539-b7bc-2655-5429-6280022106ee@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1486203896 5795 195.159.176.226 (4 Feb 2017 10:24:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Feb 2017 10:24:56 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 04 11:24:49 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZxWQ-0000y5-3X for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2017 11:24:46 +0100 Original-Received: from localhost ([::1]:38682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZxWS-0000jd-9G for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2017 05:24:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZxWE-0000jN-Bq for emacs-devel@gnu.org; Sat, 04 Feb 2017 05:24:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZxWB-0004b9-7e for emacs-devel@gnu.org; Sat, 04 Feb 2017 05:24:34 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:37804 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1cZxWB-0004ZX-1S for emacs-devel@gnu.org; Sat, 04 Feb 2017 05:24:31 -0500 Original-Received: (qmail 38190 invoked by uid 3782); 4 Feb 2017 10:24:29 -0000 Original-Received: from acm.muc.de (p4FC46ADF.dip0.t-ipconnect.de [79.196.106.223]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 04 Feb 2017 11:24:28 +0100 Original-Received: (qmail 2970 invoked by uid 1000); 4 Feb 2017 10:24:10 -0000 Content-Disposition: inline In-Reply-To: <0a40d539-b7bc-2655-5429-6280022106ee@yandex.ru> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211957 Archived-At: Hello, Dmitry. On Sat, Feb 04, 2017 at 00:08:41 +0200, Dmitry Gutov wrote: > On 03.02.2017 19:29, Alan Mackenzie wrote: > > The objectors do not seem to want compromise - they want comment-cache > > to be wholly abandoned. > It's silly to seek a compromise between implementations. Rather, we > should discuss hard requirements (with some test cases). You want comment-cache to be wholly abandoned. The requirements are simple. First, and foremost, (forward-comment -1) must work. Secondly, it should do so fast, preferably at least as fast as the current (buggy) implementation. Here is a test case from months gone by. Put point-min at the indicated position, put point at EOL, then do M-: (forward-comment -1). char foo[] = "asdf asdf" "asdf"; /* "asdf" */ /* */ /* '"'" */ ^ This test works in comment-cache. > And then we should seek the simplest solution that satisfies all of our > requirements. As simple as possible, but definitely not simpler. The "solution" you favour is too simple. It doesn't work all the time. > > They object to it for reasons I don't > > understand, despite the fact that it elegantly solves a long standing > > problem that continues to cause pain on a frequent basis. > Elegance is in the eye of the beholder. It certainly doesn't seem > elegant to me, design-wise. > > If you (or anybody else) could summarize what these objections are, I'd > > be very grateful. > "It introduces a second source of truth" seems like a concise summary. So what? There are any number of "sources of truth" in Emacs. If one of them turns out to be a "source of untruth" we call that a bug, and we fix it. > At best, it'll use more memory than it has to. The thing to do here is measure this extra memory. I did this back in spring last year, and the number of extra conses used for the cache was not inordinately high. Especially not for a 64-bit machine with several gigabytes of RAM. > At worst, we risk divergence in the information contained in those > sources (so functions depending on one or the other will behave in > incompatible fashion). That means nasty bugs that aren't easy to track > down. I think you're seeing something that's not there. You're picturing some imagined process where two alternative ways of storing information have great difficulty staying together, and somehow, over time, are destined to drift apart. Sort of like two national currencies trying to stay pegged to eachother, or something like that. That's not how computer programs work. If those two ways end up differing, we have a bug, which can be fixed like any other bug. Heck, even a single "source of truth" can be buggy, with just as severe consequences. We get bugs, we fix them. Note, in this context, that syntax-ppss is broken (bug #22983) and doesn't look like getting fixed any time soon, yet the world hasn't come to an end. > > Note that there has been NO constructive criticism of comment-cache. > That's insulting, Alan. It might be, but I think it's true. You want comment-cache to be wholly abandoned. You are not suggesting ways to make it better. You haven't tried it, that I'm aware of. You haven't looked for flaws, with the intention of getting them fixed. Instead you are putting forward reasons, not all of them good, for abandoning comment-cache. -- Alan Mackenzie (Nuremberg, Germany).