From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Zach Shaftel Newsgroups: gmane.emacs.devel Subject: Re: GSoC project - Improving ELisp Traceback and Debugging Information Date: Sat, 06 Jun 2020 19:18:15 -0400 Message-ID: <874krnss08.fsf@gmail.com> References: <87eeqv6d30.fsf@gmail.com> <878sh0rr7m.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="37733"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.8; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 07 01:18:52 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 1jhi5U-0009jp-Re for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jun 2020 01:18:52 +0200 Original-Received: from localhost ([::1]:60162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhi5T-0004pu-TA for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 19:18:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhi4w-0004OT-Tj for emacs-devel@gnu.org; Sat, 06 Jun 2020 19:18:18 -0400 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:34510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhi4w-0004sb-4U for emacs-devel@gnu.org; Sat, 06 Jun 2020 19:18:18 -0400 Original-Received: by mail-qk1-x733.google.com with SMTP id f18so13750134qkh.1 for ; Sat, 06 Jun 2020 16:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=AL2D7RRitQE9K5P1AryLP0a2UotbxzvEZ0kz5yXwGK0=; b=Feb87R0unrcf66p1aNu+2fz6hW/BDCLI0BJc8dZ0fReCMe2ilNQ55Zroqp+zQEAP3r EnqwGFn7a6CRy1js8lts6eGk1HRPc0YQqe01FBdWHtUSiTWRFgKQ8+QQC1u1dCDQ0oaH gdoJuhXKAJr/VanslUKCnwV+wX6snYajuAbsRqrzUW+zbJZ10xTsdMW52ObKTyQIUUiW HViTHPn7JiRKprx1nSif5qM/rsx4t9/5ApLLmSy+48kW3t6dU9GUGpwdZves1LfXD1AQ 5AUPurNnL++wADuDAoUblKSucpmJVo9X8nB/k30Jy09fqVl/tzAKFNt+kSouu1kwV4Zr hurA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=AL2D7RRitQE9K5P1AryLP0a2UotbxzvEZ0kz5yXwGK0=; b=R98w+Rjw9LAEhTE37DuEbbXPRnqOnRxOig+3FWF9qKQB4/aRHeIhkXqwWQgaWSh36t q3Iw0aRZsKy4Bjr0so0/E2b/KIgOv3tDOnMK9jS71Oa502xKccadydulHelfUnYOX9aO Jwu+I7J4PEDh6WV0WaQi91FRYdS0ie/0mOoVF7LIzqiV6lrrn1cl2BMI+cLiToUIfDmO MTHo0RDS4/GAYTWaQW6UyBHku6LS0jDwSQB4KUnXIvn3CE01KA9/fPpDwQBlP5Ek9AA9 MBUl3xCSoBVQvo9NmZp1tas9p7PBziehFk+u60EdXVDebUIsdIjRqoLstgIuCniAfAG5 M0yA== X-Gm-Message-State: AOAM53393KmYIgcGfHb6qhojs4tkB4hcwGigIo/r5vTpgO+lcDJNfY/n wYWsUgp7wDCTH54PBsMryc24G3y2 X-Google-Smtp-Source: ABdhPJzqVUG8R3ET4Dfky3IyWMUhgO3VbtDT5uPaKDz/YPfI+Ll9fZjpKnNHUSvl4HBc5dUshEvvmA== X-Received: by 2002:a37:a554:: with SMTP id o81mr14819241qke.180.1591485496713; Sat, 06 Jun 2020 16:18:16 -0700 (PDT) Original-Received: from arch-thinkpad (cpe-24-161-33-75.hvc.res.rr.com. [24.161.33.75]) by smtp.gmail.com with ESMTPSA id i14sm3149498qkl.105.2020.06.06.16.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2020 16:18:16 -0700 (PDT) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=zshaftel@gmail.com; helo=mail-qk1-x733.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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:251978 Archived-At: > Before converting to IR1, SBCL records the "source-path" of each cons > cell in a top-level form in the hash table *SOURCE-PATHS*. (See the > function SUB-FIND-SOURCE-PATHS defined in ir1tran.lisp). Ah okay, I guess I'm not as familiar with the SBCL compilation process as I thought. I had some trouble finding where the source path recording actually takes place so thanks for pointing that out, gonna be doing a lot more digging through the source. > Later, when the compiler walks down the (macroexpanded) form, it > searches the recorded source-path for the current form. If something > is recorded, good; if nothing is recorded, then the compiler uses the > source-path of the parent form instead (the top-level form has always > a recorded source-path). > > I think this approach is quite simple and usually works pretty well. > Most macros return part of the input arguments somewhere in their output > and so the compiler will naturally find the recorded source-path in the > hash table. Problematic are macros that completely copy/rewrite the > input. Luckily, such macros are rare. Great, that certainly does sound like something the byte compiler can manage to keep track of. > I don't know if it would work well enough for macroexpand-all and > cconv.el. But at least, it doesn't need new data types. It could also > help to manually propagate the source locations in a few places, like > macroexp--cons. That seems like a good approach and should be easy enough, and luckily macroexp--expand-all already tries hard to preserve `eq`uality of expanded forms. cconv.el might be the bigger issue, but that's a task for later. -Zach