From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Thoughts on getting correct line numbers in the byte compiler's warning messages Date: Tue, 06 Nov 2018 08:56:48 -0500 Message-ID: References: <20181101175953.GC4504@ACM> <20181105105302.GA10520@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541512496 4615 195.159.176.226 (6 Nov 2018 13:54:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2018 13:54:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 06 14:54:51 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 1gK1oh-00016p-K6 for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2018 14:54:51 +0100 Original-Received: from localhost ([::1]:41248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK1qn-0004hQ-US for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2018 08:57:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK1qf-0004h9-UX for emacs-devel@gnu.org; Tue, 06 Nov 2018 08:56:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK1qc-00008W-Jv for emacs-devel@gnu.org; Tue, 06 Nov 2018 08:56:53 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK1qc-0008T9-DT for emacs-devel@gnu.org; Tue, 06 Nov 2018 08:56:50 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wA6DumLd012985; Tue, 6 Nov 2018 08:56:48 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 295A86A522; Tue, 6 Nov 2018 08:56:48 -0500 (EST) In-Reply-To: <20181105105302.GA10520@ACM> (Alan Mackenzie's message of "Mon, 5 Nov 2018 10:53:02 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6412=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6412> : inlines <6952> : streams <1803483> : uri <2745182> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:231040 Archived-At: > Actually this idea was not good; [ I'll assume you're not talking about the idea of using such a reader in edebug, but about using such a reader for your use case. ] > macros could not handle such a form without severe changes in the way > macros work. (A research project, perhaps). Right. The way I was thinking about it was that when calling macros we'd do something like: (plain-to-annotated (macroexpand (annotated-to-plain sexp))) not a research project by any stretch, but its impact on performance could be a problem, indeed. > The reader would produce, in place of the Lisp_Objects it currently > does, an object with Lisp_Type 1 (which is currently unused). The rest > of the object would be an address pointing at two Lisp_Objects, one > being the "real" read object, the other being a source position. More generally, you're suggesting here to add a new object type (could just as well be a new pseudo-vector or any such thing: these are just low-level concerns that don't really affect the overall design). > The low level routines, like CONSP, and a million others in lisp.h would > need amendment. So you're suggesting to change the low-level routines accessing virtually all object types to also accept those "annotated objects"? That means all processing of all objects would be slowed down. I think that's a serious problem (I'd rather pay a significant slow down in byte-compilation than a smaller slowdown on everything else). > But the Lisp system would continue with 8-byte objects, > and the higher level bits (nearly all of it) would not need changes. > The beauty of this scheme is that, outside of byte compilation, nothing > else would change. Also, I wonder how this (or any other of the techniques discussed) solve the original problem you describe: The forms created by the reader go through several (?many) transformative phases where they get replaced by successor forms. This makes things more difficult. E.g. we could implement big-object as (defun big-object (object location) (cons object location)) or (defun big-object (object location) (puthash object location location-hash-table) object) or (defun big-object (object location) (make-new-special-object object location)) but the problem remains of how to put it at all the places where we need it. > The extra indirection involved in these "big objects" would naturally > slow down byte compilation somewhat. I've no idea how much, but it > might not be much at all. Indeed, I don't think that's a significant issue. Stefan