From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Update 1 on Bytecode Offset tracking Date: Sat, 18 Jul 2020 22:34:24 -0400 Message-ID: References: <87a700fk3j.fsf@gmail.com> <87blkfoz9v.fsf@gmail.com> <87wo31sxmu.fsf@gmail.com> <87zh7wjybj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13367"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Zach Shaftel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 19 04:35:03 2020 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 1jwzAM-0003Mi-Ju for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Jul 2020 04:35:02 +0200 Original-Received: from localhost ([::1]:41648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwzAL-0005xi-Lf for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jul 2020 22:35:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwz9q-0005U8-Oh for emacs-devel@gnu.org; Sat, 18 Jul 2020 22:34:30 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwz9o-0003Iu-K4 for emacs-devel@gnu.org; Sat, 18 Jul 2020 22:34:30 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 06B9D805AC; Sat, 18 Jul 2020 22:34:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 42621807F4; Sat, 18 Jul 2020 22:34:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1595126065; bh=tpMNHKffOe1u0AUygGtghCmHPrZLf1M5HlrTYibprUc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gYUTwpwzOfnFjOvEVOt6fcBsbcvgqrEnJrS0JfMrTFJW5N5mk3ZdaM9x/sJti5JnN A7aoA9opBdInwd0z2rclS1GSU0VYF5+Q+HciFJrx1PsBiAILn4Y8hybGaVDDypXruI vHeE1ocdvzYtEqdxXZVR+8uMNKqPgDFpms4m7sXHHzGr3Dx8ff4IEZ2aPiGoz5bc7+ TNugyFQGKQXCcljxuEZtB7nZecTEMWIiUtJi/1x8nTVplF3vEqm7bvTB4nuQlumGL6 ul5zIfwT4lNFdha82RX4P3+4ahUmXNM/0invOyiUEXF8an3fFyyS+oKz2R9VEV8Skp AnhASY+syEBwQ== Original-Received: from milanesa (76-10-180-175.dsl.teksavvy.com [76.10.180.175]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 02BBE120535; Sat, 18 Jul 2020 22:34:24 -0400 (EDT) In-Reply-To: <87zh7wjybj.fsf@gmail.com> (Zach Shaftel's message of "Sat, 18 Jul 2020 17:41:20 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/18 22:34:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:253092 Archived-At: > Sure, I'll do some more exhaustive testing. So far though, the results > aren't great, the biggest issue being memory usage. The > `source-map-read` can GC over 5 times more often than `read`. Sounds fine for a prototype. > I think it's more sensible to accept that a real implementation will > have to be in C and this reader will just remain a prototype. Indeed. > Aha, I had never even considered hygienic macros in Elisp (nor had I > recognized how trivial it is to track their source-code). That would be > an amazing development for Emacs Lisp, but is certainly a huge > undertaking, not something I could fit into the GSoC timeline. No, I'm just discussing what the longer-run might look like. > I know that it has been done in Common Lisp (by Pascal Costanza), but > I believe that implementation serves the sole purpose of capture > avoidance and doesn't abstract syntax. For Emacs I assume this would > have to be done in C, but I do wonder if an Elisp implementation would > be possible. I haven't thought very much about it, but I can't see any reason why it would need to be done in C, no (tho I wouldn't be surprised if it could benefit from a bit of help from the C side, of course). > Doing the similar thing in Elisp -- relegating source location tracking > to code using only a specialized kind of macro, hygienic or otherwise -- > would of course be a major loss, since it would take years for that new > paradigm to become commonplace. Indeed, we'll need some fallback heuristic for all the existing `defmacro`s. Part of the issue is "tracking source location" but another important part is to take the annotated source code and "de-annotate" it (recursively) to pass it to the macro, since the macro expects a raw sexp. That's why we've been thinking about annotated representations which are "transparent" (i.e. can be used as if they weren't annotated). Either using "fat cons-cells" or using "fat symbols" or storing the annotations in an eq-hash-table. Another way to attack the problem is to rely on the Edebug spec: you can refrain from de-annotating all the parts marked as `form` or `body` (as long as the annotations themselves look sufficiently like normal code, at least). Stefan