From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: scratch/accurate-warning-pos: next steps. Date: Mon, 10 Dec 2018 22:06:33 +0200 Message-ID: <83y38x1706.fsf@gnu.org> References: <20181210180033.GC4188@ACM> <831s6p2qq1.fsf@gnu.org> <20181210182830.GD4188@ACM> <83zhtd1b0j.fsf@gnu.org> <20181210193557.GE4188@ACM> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1544472291 1190 195.159.176.226 (10 Dec 2018 20:04:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Dec 2018 20:04:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 10 21:04:47 2018 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 1gWRnL-0000Ba-2P for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2018 21:04:47 +0100 Original-Received: from localhost ([::1]:34573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWRpR-0008UR-J4 for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2018 15:06:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWRpL-0008UB-L9 for emacs-devel@gnu.org; Mon, 10 Dec 2018 15:06:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWRpH-0001zA-Ki for emacs-devel@gnu.org; Mon, 10 Dec 2018 15:06:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWRpH-0001z4-H5; Mon, 10 Dec 2018 15:06:47 -0500 Original-Received: from [176.228.60.248] (port=3685 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gWRpG-0002Cq-HS; Mon, 10 Dec 2018 15:06:47 -0500 In-reply-to: <20181210193557.GE4188@ACM> (message from Alan Mackenzie on Mon, 10 Dec 2018 19:35:57 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:231747 Archived-At: > Date: Mon, 10 Dec 2018 19:35:57 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > Then how about invoking this alternative interpreter only if the prime > > interpreter detected a warning or error while byte-compiling? You > > could invoke the alternative interpreter only on the form where the > > problem was detected, with the goal of "drilling down" to find the > > exact position of the problematic symbol(s). > > That would mean starting the byte compilation with no position > information being gathered, and then when an warning occurs, aborting > the compilation and starting again from scratch with the position > information being gather and alternative interpreter being used. Not necessarily. It could mean invocation of a special code whose goal is to find the position of an error in a given form. The position of the beginning of this form will have been known, as AFAIU the existing byte compiler does collect that, or has means to determine that. > The problem is, that we cannot use # in the normal > interpreter, since it is not EQ nil there. I'm not sure you must use symbols with positions in the above arrangement, you could simply invoke special-purpose code that analyzed the problematic form. But if you do need to use symbols with positions, you could do this only when looking for error position, so other symbol comparisons will not be affected. > I understand the idea, yes. But given the timings I measured in the > existing scratch/accurate-warning-pos (IIRC, around 11% - 12% for an > actual compilation) and the fact that in the alternative interpreter, > the slowdown will be somewhat less (one fewer flag comparison per EQ, > NILP, ...., and we can drop the traditional alist of symbols and > positions which is running alongside the new symbols with position) it > may not be worth the extra complexity. Yes, but what you suggested as the implementation of the alternative interpreter includes a heck of complexity of its own, IMO. The idea I proposed doesn't even require changes in basic types, it could hopefully be implemented with "normal" Lisp.