From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Brooks Newsgroups: gmane.emacs.devel Subject: code annotations Date: Thu, 04 Nov 2021 22:21:11 -0700 Message-ID: <87fssbqit4.fsf_-_@db48x.net> References: <83ilxajyhw.fsf@gnu.org> <83fssejxf8.fsf@gnu.org> <835ytajsv2.fsf@gnu.org> <831r3yjqo9.fsf@gnu.org> <83v91aibe7.fsf@gnu.org> <87o872s0wf.fsf_-_@db48x.net> <83lf25gm1j.fsf@gnu.org> <83ee7xgio2.fsf@gnu.org> <87fssdrp54.fsf@db48x.net> <831r3xgfz3.fsf@gnu.org> <87v918qx37.fsf@db48x.net> <83o870fjqg.fsf@gnu.org> <87k0hnqr1v.fsf@db48x.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16931"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org, cpitclaudel@gmail.com, monnier@iro.umontreal.ca, yuri.v.khan@gmail.com To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 06:23:02 2021 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 1mirgr-0004Bx-Iw for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 06:23:02 +0100 Original-Received: from localhost ([::1]:42386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mirgp-00063d-Fp for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 01:22:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mirfB-0005Kl-HB for emacs-devel@gnu.org; Fri, 05 Nov 2021 01:21:17 -0400 Original-Received: from smtp-out-4.mxes.net ([198.205.123.69]:14389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mirf9-0006fT-Ly for emacs-devel@gnu.org; Fri, 05 Nov 2021 01:21:17 -0400 Original-Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 4Hlpkw70CYz3cBZ; Fri, 5 Nov 2021 01:21:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1636089674; bh=cGgs7vEi9P+O1kfpC85FWkprI/poHJel7fXQNdv/0Mk=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=znOXb3+7TBtceqvTaX8zHMB7yquCBbOAvU48bZdKAxDcVPnLC6yJufhkH/013mE5Q rxFrkMipfErW1GNlqdxR2khr/Q3MxZOp//JCWUj6t5CMUZI7IC3x6q7CLCgfuzBnu1 dpiaAdVDvSG0tMh7dFv+Gv61EzpPk3nnr4h+IzrQ= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGOfPtRkwAAABJQ TFRFpKfbdou67PD6JjJgAwUWXGSeIcyLHgAAAkZJREFUOI1VU8Fy6yAMxLi+Q13fCZ3cnQL3dqTc 7RD+/1feStDXVnXHDuvVSivZTMba2GPdw3gyCGcMAFxTyrTd9dwGoxHiZX9PmRFUHYAQlGGtXY+F Uk0SJOxgJiUEnH1qkitT9D+pQub7qGAmUbR6bu3CvI96Yv6QqkBBMrsyfZccr1/RDXGDTLf4P7ZY glVxe2V+/ACXWO1gvDO9/gDRpFFVmPluvLcmBjd5H6d8DEte+Pbk4rcY/Fa5tLKLOtCZsuQKYhpa LOkYDT7hESya7/WIET3lfQBqX0pwFtbI832Is0ayMUR9B+12xjgPCQ089cfwkCkX6L5TPmRelJTh zMS0Sz1PyjLAMCUWjcmgQLWQMds+e3aaauZDf9dU9A2/8kPVF2odCUoMKHkfjJR+mbgC+DRiycw5 3XSqGe6HmhN/AWjHypkAXOAFW5EiuA1ge2GiZuMb0s1fSEXcATeLUfbyEY2L8yPOmdSsdghQXx3K pz2eoeXuYvMCINVFDrCdNfVUp4eJ6cSEbjbgFjBEvonGGTrgv9cHjAc8aVgSAPoxaONbzfwhDIhR at7IIS7fAGiDSwIA9alhhTBzfA7YM2FY6eMwayrIGK8FDFmshmUA43WqhFtpvoqG9HHaJ7fqtgTz 8EWVkgZgtsylFliHDgk0MB7KAEC45C/rgnGvanNLXyzOeTzcT2nw/N44gfrtYXRQLoz9Q3TgmJRx 2Mx/Q51qzpm+l3m8z2SWBqC5+PZXAtNYlGFf/gKfHfjFkDT4x7od7R+w3Ls+ZdQBuQAAAABJRU5E rkJggg== In-Reply-To: (Stefan Kangas's message of "Thu, 4 Nov 2021 20:52:21 -0700") X-Sent-To: Received-SPF: none client-ip=198.205.123.69; envelope-from=db48x@db48x.net; helo=smtp-out-4.mxes.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:278733 Archived-At: Stefan Kangas writes: > Daniel Brooks writes: > >> Rust also has a very flexible annotation system that allows the >> programmer to annotate specific statements and language items. If a use >> of these characters is determined to be legitimate, the programmer can >> annotate the comment, or the function the comment is in, so that this >> error is disabled. In projects with strong review culture, seeing that >> annotation while doing a code review will be a very strong signal that >> something unusual is going on, and that it needs to be considered >> carefully. Annotations are are a great feature of Rust that I do not >> expect Emacs to take into account. > > We already have `ignore-errors', `with-suppressed-warnings', etc. > That sounds as powerful as the annotation system you describe, or am I > missing something? `ignore-errors' is not similar, because it operates only a run time. I had forgotten about `with-suppressed-warnings', which can suppress warnings while byte compiling; that is indeed similar. Does it operate at read time though? On the other hand, Rust annotations are used for a few other things as well, besides enabling or disabling warnings and errors. They are used for conditional compilation, telling the compiler to do extra work for you (derive, for example), specifying linking options (static vs dynamic linking, for example), code generation (inlining, etc). And the list can be extended by macros. The reference is here: https://doc.rust-lang.org/reference/attributes.html db48x