From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: guile 3 update, halloween edition Date: Fri, 15 Nov 2019 10:03:49 +0100 Message-ID: <87sgmp1pfu.fsf@gnu.org> References: <87o8xyhtz6.fsf@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="55131"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Guile Devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Nov 15 10:04:24 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iVXWh-000E4C-If for guile-devel@m.gmane.org; Fri, 15 Nov 2019 10:04:23 +0100 Original-Received: from localhost ([::1]:36840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVXWg-0001EV-Cq for guile-devel@m.gmane.org; Fri, 15 Nov 2019 04:04:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47068) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVXWD-0001A1-By for guile-devel@gnu.org; Fri, 15 Nov 2019 04:03:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iVXWC-0001Ig-P2; Fri, 15 Nov 2019 04:03:52 -0500 Original-Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=40814 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iVXWB-0008MH-JV; Fri, 15 Nov 2019 04:03:51 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 Brumaire an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: <87o8xyhtz6.fsf@pobox.com> (Andy Wingo's message of "Wed, 30 Oct 2019 21:13:49 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20145 Archived-At: Hello Andy & all! Thanks for the great summary. I=E2=80=99ve taken a look at =E2=80=98wip-exceptions=E2=80=99, which is als= o remarkably easy to follow because all the changes are incremental and follow the path you explained in your message; thanks a lot for making it this clear! I=E2=80=99ve very much support this change, I always found the key+args convention to be poor compared to structured error condition objects. The changes in =E2=80=98wip-exceptions=E2=80=99 all make sense to me; some = random comments below. 0. Do I get it right that =E2=80=98throw=E2=80=99 and =E2=80=98catch=E2=80= =99 are not =E2=80=9Cdeprecated=E2=80=9D in the sense of (ice-9 deprecated) and are instead simply not the =E2=80=9Cpreferred=E2=80=9D exception mechanism? At least, that=E2=80=99s how I would view it :-), because =E2=80=98throw=E2= =80=99 cannot (yet) disappear from C code, and because it=E2=80=99s a migration that could take= more than two stable series to really complete. 1. I see things like: +(define (make-condition type . field+value) + "Return a new condition of type TYPE with fields initialized as specified +by FIELD+VALUE, a sequence of field names (symbols) and values." + (unless (exception-type? type) + (scm-error 'wrong-type-arg "make-condition" "Not a condition type: ~S" + (list type) #f)) and: + (unless (symbol? key) + (throw 'wrong-type-arg "throw" "Wrong type argument in position ~a= : ~a" + (list 1 key) (list key))) I guess we could add a specific =E2=80=98&type-exception=E2=80=99 exception= or similar, which would allow us to improve error reporting (that can come later, of course.) Guix has =E2=80=98&location=E2=80=99 error conditions, which I=E2=80=99ve f= ound useful when combined with other error conditions in cases where location info from the stack isn=E2=80=99t useful: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm#n832 I wonder if (ice-9 exceptions) should provide something like that. 2. What are you thoughts regarding exposing structured exceptions to C? I=E2=80=99ve always been frustrated by =E2=80=98system-error=E2=80=99 :-). = Guix has a hack to augment =E2=80=98system-error=E2=80=99 with information about the offending= file name: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/ui.scm#n520 If the POSIX bindings would emit a structured =E2=80=98&system-error=E2=80= =99 record, that=E2=80=99d be pretty cool. 3. I wonder if we could take advantage of the new =E2=80=98&message=E2=80= =99 exception to start i18n of error messages. It might be as simple as telling xgettext to recognize =E2=80=98make-exception-with-message=E2=80=99 as a ke= yword, though currently there are few calls to =E2=80=98make-exception-with-message=E2=80= =99 followed by a literal. 4. Is =E2=80=98&warning=E2=80=99 actually used? Is the goal to make it con= tinuable? That sounds great. Bah, you give us a present and I reply with an additional wishlist. ;-) Anyway, =E2=80=98wip-exceptions=E2=80=99 looks great to me as it is, so I= =E2=80=99m all for merging it to =E2=80=98master=E2=80=99. Thanks a lot! Ludo=E2=80=99.