From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Correct line/column numbers in byte compiler messages [Was: GNU is looking for Google Summer of Code Projects] Date: Fri, 20 Mar 2020 17:27:34 -0400 Message-ID: References: <20200319203449.GA4180@ACM> <20200320201005.GC5255@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="44236"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 20 22:28:19 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 1jFPBh-000BNO-RG for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Mar 2020 22:28:17 +0100 Original-Received: from localhost ([::1]:59362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFPBf-0004ax-FQ for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Mar 2020 17:28:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44589) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFPB8-0004B7-8E for emacs-devel@gnu.org; Fri, 20 Mar 2020 17:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFPB6-0000v3-2P for emacs-devel@gnu.org; Fri, 20 Mar 2020 17:27:41 -0400 Original-Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:45896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFPB5-0000tA-5h for emacs-devel@gnu.org; Fri, 20 Mar 2020 17:27:39 -0400 Original-Received: by mail-qv1-xf30.google.com with SMTP id h20so3836474qvr.12 for ; Fri, 20 Mar 2020 14:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=+3Ewv/kCtS74T+Dem10WcW70yKBU1E1+i64l47RZ7Is=; b=RHHniHqfUlnt/D/Pj9Fa1VpIdsTa8NuN3705wSWXbu+vbUoZNJqc6gJtvEddswwoGy cV1k2BAye4X4LbGzQX7ud8bdE5tjnXtZ9bzrSsvIG1UurB6BQT2dn0vFzcgCmZAPjqiE clApOic9HY76sSeSP+HdDwaO0bifAJTCSFlyRqiSLG6UUlYwHhF5yHlYjiZehpxYUUBr Hxx06Zwg2JK6vJ6BHMlhlib2p8IVfKl+afd/lkw9BURpsFuJFcl0mwL6Jj7MtozllPNb UbP9RpnCJIQRq6lPp1vmSYgHNig/X/1+GKdRJ5XkpoC5las8MwHJRSbsf/wPj6xWg3yo 4sVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+3Ewv/kCtS74T+Dem10WcW70yKBU1E1+i64l47RZ7Is=; b=e7WTz7zjShkYj0YNXw/Tpz5sk6Vl5bDjwmJbCOzPa6u0u6baisQMjy9mZf1+TqCjLZ tWRtyv7Go0yChjh9mSd8P8gaemBXNyciWRgh0MYJadwE7cF6+/0sxpm0YnGfveDTBypn dSNJ+AH1Mr5GnI3PIBdF0gj/ci+2b4w2Qm/IvlEvvzhnKEI+xCnaYi5Q2SpaeBRGFiq8 omESOXqZ1fh4MwIrlYAukNSAGiP85HuUmPu7Ng9Kvzssm0U3SYvlbYPvD3CpwvyuYFZy dM+CbrbqY7xJ902Z6R6mq2sstHkKGdn7rtsEXO8FJCUAHegavsLrBcTifzkfM+dEhUW1 jskw== X-Gm-Message-State: ANhLgQ3bpXvIxcxFOpd1DGetdmrWyV5ivmnOXu/5Nlp17Q4w3XUWmB19 Rh90t2fHMO4VCRHxonKr+nMMM53r X-Google-Smtp-Source: ADFU+vtoleiGSLKXLtfFDGi74GDCy/OOwX5xBvMDu6zftzJl4ESDJeClxWW0eDazF0SJUnPywwPELg== X-Received: by 2002:ad4:588e:: with SMTP id dz14mr10474081qvb.103.1584739658274; Fri, 20 Mar 2020 14:27:38 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:b9ec:a7c2:617d:8aac? ([2601:184:4180:66e7:b9ec:a7c2:617d:8aac]) by smtp.googlemail.com with ESMTPSA id q24sm5796685qtk.45.2020.03.20.14.27.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Mar 2020 14:27:37 -0700 (PDT) In-Reply-To: <20200320201005.GC5255@ACM> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f30 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:245614 Archived-At: On 20/03/2020 16.10, Alan Mackenzie wrote: > Are you saying that this is how other Lisp compilers deal with > source code positions? How do they deal with the difficult problem > of user macros? Could you give me an example of a free Lisp system > which works this way? I'd be interested in having a look at it. not sure if it counts as a Lisp compiler, but Racket does this; the "fat cons cells" are called syntax objects. See https://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html for a good explanation, including this intro: > The main idea with Racket’s macro system (and with other syntax-case > systems) is that macros are syntax-to-syntax functions, just like the > case of defmacro, except that instead of raw S-expressions you’re > dealing with syntax objects. This becomes very noticeable when > identifiers are handled: instead of dealing with plain symbols, > you’re dealing with these syntax values (called “identifiers” in this > case) that are essentially a symbol and some opaque information that > represents the lexical scope for its source. In several syntax-case > systems this is the only difference from defmacro macros, but in the > Racket case this applies to everything — identifiers, numbers, other > immediate constants, and even function applications, etc — they are > all the same S-expression values that you’re used to, except wrapped > with additional information. Another thing that is unique to Racket > is the extra information: in addition to the opaque lexical context, > there is also source information and arbitrary properties (there are > also certificates, but that’s ignorable for this text). It would be worth checking more closely what Guile does. Its syntax-manipulating functions automatically propagate "source properties", but from reading https://www.gnu.org/software/guile/manual/html_node/Source-Properties.html it seems that it might use something similar to your approach? Clément.