From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CCoKN3vChGODSAAAbAwnHQ (envelope-from ) for ; Mon, 28 Nov 2022 15:15:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id OK83NnvChGNUFQAAG6o9tA (envelope-from ) for ; Mon, 28 Nov 2022 15:15:23 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3D2843B170 for ; Mon, 28 Nov 2022 15:13:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozes5-0006ee-Us; Mon, 28 Nov 2022 09:12:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozes0-0006bu-Kz for guix-devel@gnu.org; Mon, 28 Nov 2022 09:12:29 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozert-0004Rd-HQ; Mon, 28 Nov 2022 09:12:25 -0500 Date: Mon, 28 Nov 2022 14:12:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1669644735; x=1669903935; bh=042xtM6kJEA/Fs1vW/pOKzIdwSn7m0rXmx4fOWHYYwI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RqX7N55acGrKrXXQ8NT7HjiLAfIJeBUGDXa94B9/N5SOgZPI6blm5mRX6v4+T8tSN aifbDadwtbcih/cDyrFQh4HF4C+1hdIDHGItZsaub31uIYNxbKbtn0oP8lqGG7jZ7p Jcf3AJ/L8fLNTM8pIbWcqjePVTeVu/VZp9UB/Y285v5YnOGuSTjn509vKB+A6rnn4d 8jB1iZ/REMUiZa7RTe1grHQALmcw7x9/Bpgv20PXv2U5umYEkKUbfJ2afthquRdlEy 2E1+1Zigtggfwi2jjTyRHU9Keabtv6ha98lis1/Emt8ZpskJX8cQ6W4rtVDM7HA82V cGXdVg5jPmrGQ== To: =?utf-8?Q?Ludovic_Court=C3=A8s?= From: Attila Lendvai Cc: Maxim Cournoyer , zimoun , guix-devel Subject: Re: Guile debugger workgroup? Message-ID: In-Reply-To: <87h6yje3op.fsf@gnu.org> References: <20221027035100.28852-1-maxim.cournoyer@gmail.com> <87y1s82o23.fsf@gmail.com> <87zgckwdtw.fsf@gmail.com> <87sficqb71.fsf@gmail.com> <86fsebdpl9.fsf@gmail.com> <87r0xrjbx1.fsf_-_@gmail.com> <87fse69czr.fsf@gnu.org> <87h6yje3op.fsf@gnu.org> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.136; envelope-from=attila@lendvai.name; helo=mail-40136.proton.ch 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669644802; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=042xtM6kJEA/Fs1vW/pOKzIdwSn7m0rXmx4fOWHYYwI=; b=DwyZCGqVi564I6e5IWTh3Vaf/jOtg7YZHRjj8Uy/VXHpKvg31vlQqpvHZV17Hzn2Oub8QP eccPHMzZ7xyV7v3OXyCGGbY+ySwsMYUwhL39v91mXe2LbFY1RyfbVqCAq2llf7OmaZ4D0e E8xU3Bv3+T8YD7gSCWWhNdhhooNjQ8IOA3ZPRzTZ6N6WoziBm75pbAJ1Y91yRmKnEF1skA +7AAEM0Bxe+kDybhfsfvQCUInxptF+UWTlCkFjDxQxNGK+uKmnw0KawQ90l7bEJNyjLi7V D1Kf9lQtw3ooEGI7q2gu1Vs9YqVrFnWarzIvxlA5M35YreE0uMeHtfwqGNPBGQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669644802; a=rsa-sha256; cv=none; b=AyHTqWKCgeft9+t7A9ocR1LtzpXFegLHo/IfZbhkZ3CnisOFfMmux3NO0clLKyWEQHI7G+ Ao37UqC8mX8T3oddVoD/NMAND7PPlCTOtDuMXo6IhbeAoNcwxqeOHc/Fr/Ln+N/5rc7tYm 4u6H/v4pR4zOMaMi4XSNH0Hz5g5YAc46ICTZGReSiD4CgP3euX9Y3oiN2MCWof6ZRl47j5 rHn01IJyekcAn5F2i9Vtu0iuUulSLeEvr7lJqQpR1oEOXCBk+HnTQesGqRTE43KQND9hwF dNlMlcrkc7t2GqOM+Mz/42HlNYpdPWrwfsbAxZNxGaj6Kh/FAfc2LqkC4X7fmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail2 header.b=RqX7N55a; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail2 header.b=RqX7N55a; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3D2843B170 X-Spam-Score: -0.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: nIJFyGo8riXY > Do you have examples in mind of things you=E2=80=99d like to log and that= would > have helped you on a debugging journey? the first thing that pops to my mind is the service start gexp's in shepher= d: they felt impossible to debug. i often was pretty much resorting to star= ing at the code, and then trying ad-hoc changes (with a minute+ long edit-c= ompile-test cycle). there are multiple issues here. the first one is that there's no proper err= or handling in shepherd. but if there was at least a semi-global error hand= ler, that logged a full backtrace into a log file, then it would have been = immensely helpful. for inspiration, this is what we developed in common lisp: https://hub.darcs.net/hu.dwim/hu.dwim.util/browse/source/error-handling.lis= p#10 WITH-LAYERED-ERROR-HANDLERS is a macro for which you can provide a "level 1= " error handler hook that does whatever it wants. if any errors happen with= in this hook, then a level2 error handler kicks in, turns off several thing= s (e.g. custom PRINT-OBJECT methods), and tries to log a backtrace in a def= ensive way (e.g. there are error handlers installed while printing each bac= ktrace level). if even level2 errors out, then a super conservative level3 error handler l= ogs this fact, so that there's *some* sign of an error. note that the logging library must also be smart about how it deals with er= rors. the default level1 handler has fancy features like "backtrace decorators", = which is a registry of dinamically bound thunks that are called when a back= trace is printed. they can decorate the end of the backtrace with dynamic i= nformation from the context that is not captured by the backtrace (e.g. the= web session, the user logged in, etc). this error handler mechanism is installed at strategic points, like the han= dling of a http request, or a great candidate would be when calling the use= r code in the start gexp of a shpeherd service. let me know if anything like this is available in scheme. i know about these in guix and guile: /guix/ui.scm: (define (call-with-error-handling /module/system/repl/error-handling.scm: (define* (call-with-error-handling the longer i work on/in guix, the higher the chance that i'll port parts of= our CL debugging stuff to scheme. i think i was just procractinating it un= til i develop a deep enough understanding of scheme to do it properly. HTH, --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CWe are caged by our cultural programming. Culture is a mass halluc= ination, and when you step outside the mass hallucination you see it for wh= at it's worth.=E2=80=9D =09=E2=80=94 Terence McKenna (1946=E2=80=932000), from the lecture 'Eros an= d the Eschaton' (1994)