From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: A Guile debugger workgroup? Date: Tue, 29 Nov 2022 17:58:24 +0000 Message-ID: References: <87edtlptgv.fsf@laura> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11833"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Olivier Dion Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Nov 29 18:59:06 2022 Return-path: Envelope-to: guile-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 1p04ss-0002uv-FB for guile-devel@m.gmane-mx.org; Tue, 29 Nov 2022 18:59:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p04sT-0008Jk-Uk; Tue, 29 Nov 2022 12:58:41 -0500 Original-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 1p04sS-0008JZ-Lh for guile-devel@gnu.org; Tue, 29 Nov 2022 12:58:40 -0500 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p04sP-000306-Jf for guile-devel@gnu.org; Tue, 29 Nov 2022 12:58:40 -0500 Original-Received: by mail-wr1-x42e.google.com with SMTP id z4so23405780wrr.3 for ; Tue, 29 Nov 2022 09:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Wqt4HSoI7icNGQ92YIW5aNDEHfA4FCHJKrIV7OcXano=; b=JgEjatN6KmlYCWo6lgAt4xn7x995xgoj3fuM7vG/FShY+CwilZ+dsAOvOtV67pfFiO WT7c0A7a7Q18AX2QZ8FNXhMbYn56YXncMJWXC3A7iaH+whQmyovnOucWDIpRgQm4avFa yH3LmSqtOR7/Zam60AEsLhJ9loy0a6eIXagIFKDDCfZBKTKOKAssasgQqsMNeKpLlIml Jmrj4XspDqPi5uaEC4JafsnqH8LAxThUhU1HvK4X7Z8I5ddN/2zgPLyPnKJ1uzxU4C1E unTBmAYZozPOTT5ftgCSUdzhesUxqhXQLdz+dlV0pVpbWy19707kD3LdJiT7KIsv/Ewl SLpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wqt4HSoI7icNGQ92YIW5aNDEHfA4FCHJKrIV7OcXano=; b=vFlqm/JUEWycOtevGDE6ynKEf0yNNgvKxjDSABzbCzT2lGgzw+dxXU6U84ezay6FcT dNSNT+T06s3EJ99tmlZg2cXHkrxNkIbriYDBhAbAIk2cQa+2g4kfqna7rnvnjMvmNG2V /YZKoPc38VHtOKZnO1LJ5U0oRTWJhBPAbhrdrrdMr0Tuf72zDTW0qdFmOxMruac24zDa KB7b20RN7yNee9xOV51OvYB1M1ZZ608VpXRUyFFat3kdLfiAqWpNvwe1pcqPnRISJySm OSHPvK2o2xqO2z0jcOS/Sm5IUSCP1XMhi6AJ3Q2XTNsn6KtZh3aqz9z+4o4jzRo+u+d4 PwJQ== X-Gm-Message-State: ANoB5pmRkXxFxQGYWHmH8LB1YEGOubWwyzM6oTY1T7er2h/stEJZ8OJo 2sIBMcvX7VvY3+83ZGxCOpOh5d3uRm8jic5byZHBj/iECdA= X-Google-Smtp-Source: AA0mqf73gMlDVRtXLzvdrOlNWqaURIVaGdHOqM1hMSNu0Fe7o8eVzkmXx+nQ4oFrnFJfMU+OcBCFQQfc2vOxDsmUZh0= X-Received: by 2002:a5d:6ac7:0:b0:241:bf95:c9a2 with SMTP id u7-20020a5d6ac7000000b00241bf95c9a2mr32901753wrw.387.1669744715287; Tue, 29 Nov 2022 09:58:35 -0800 (PST) In-Reply-To: <87edtlptgv.fsf@laura> Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=neiljerram@gmail.com; helo=mail-wr1-x42e.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21488 Archived-At: I wrote something called GDS, back in 1.8 days, that combined some of the Emacs interaction features that we now have with Geiser, with step-by-step debugging and breakpoints. You can read about that here: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Using-Guile-in-E= macs.html#Using-Guile-in-Emacs Unfortunately the debugging side of GDS was based on the low level traps in the 1.8 interpreter, and that was all blown away in the 2.0 rewrite, so GDS stopped working at that point. I don't know what modern equivalent 3.x has to the 1.8 low level traps - perhaps we would instead advocate for recompiling the relevant code with extra instrumentation, like edebug does? On Tue, 29 Nov 2022 at 17:21, Olivier Dion via Developers list for Guile, the GNU extensibility library wrote: > > Greetings Guilers, > > There's been a discussion on the state of debugging with Guile on the > guix-devel mailing list. Here's the relevant link if you want the full > discussion: > > which is a reply to . > > I'm going to resume what I've gather here. I've mainly cutoff Guix > related stuff. I'm also putting names here for the sake of clarity. > > I think it would be interesting to have more inputs from the Guile users > at large -- outside of Guix -- on that topic. From my personal > experience and the echo I get back from other users, the debugging > experience in Guile is frustrating. > > Things I've gather in this reading and on the IRC with other users. > This is by no way a wish list, but simply ideas to improve the debugging > experience: > > 1. Documentation on debugging should be improved. e.g. The `pk` > procedure. > > 2. A tutorial on how to debug a project with `pk` and the REPL. > > 3. A single-step (instruction and line) debugger. > > 4. Integration in GDB. e.g. GDB could insert breakpoints in Scheme > code. > > 5. Maybe not make a debugger with a paradigm for language like C but > instead take inspiration from other Scheme implementation like > Racket. > > Resume start here: > > zimon: > > Preparing some materials for introducing Guile to GuixHPC folk, I am > trying to collect some tips and, if I am honest, the debugging > experience with Guile is really poor; compared to others (as Python). > For example, DrRacket provides an easy and nice user experience > > Well, IMHO, we are somehow suffering from some Guile limitations and > improvements in this area are an hard task. > > Maxim: > > I also agree! It's hard to convince people to pick Guile for their > project when there is: > > 1. Lack of a debugger that can break and step anywhere in your source > code > > 2. Lack of debugger integration to an IDE (it's not even integrated > into Emacs) > > Perhaps we should assemble a Guile debugger workgroup that'd review > what's broken, what's missing, what can be borrowed from other Scheme > or languages for inspiration > > Ludo: > > Well, Guile has a debugger that lets you do that [...] Geiser is not > Visual Studio=E2=84=A2 but it does a good job. > > Also, [...] I mentioned before that I almost never use breakpoints on > Guile code [...] because it=E2=80=99s rarely the right tool for the jo= b. > > I believe this is largely due to (1) writing functional code, and (2) > doing live programming at the REPL. Why would you use breakpoints > when you can just call the relevant procedures on some input to see > how they behave? > > So I think you won=E2=80=99t convince people to pick Guile for their pr= oject > by selling it as a C/C++/Python drop-in replacement. Guile is about > functional programming and live coding so the set of tools differs. > > Despite what I wrote, I think it=E2=80=99s a good idea. I suppose insp= iration > would come from other Schemes, in particular Racket, and perhaps from > other live-coding systems (Common Lisp, Smalltalk, etc.), rather than > from Python or C. > > Zimon: > > Maybe I am wrong or miss some Guile features. From my experience, the > issue is not the way that the information is presented or how we > interact with it (Geiser or else) but, instead, the issue is the > availability of such information. > > Well, so you are using the good ol=E2=80=99 way putting =E2=80=99pk=E2= =80=99 here or there, > right? One thing when debugging is to inspect the current state of > the program; [...] And, =E2=80=99pk=E2=80=99 is the poor man breakpoint= . :-) > > Racket is an example of functional programming and live coding. > Haskell is another; it is functional programming and if I might, I > would recommend to give a look at the interactive GHCi debugger > > Maxim: > > When searching for how the debugger work in the Guile Reference info > manual, I also don't find anything useful: only the gut of the > debugging API of the Guile VM appears to be documented ("Debugging > Infrastructure"), so documentation is another place that could be > improved, with some examples and pro tips for real life, practical > debugging with Guile. > > Ludo: > > I think we should identify scenarios where things don=E2=80=99t work as > expected, and then turn them into bug reports, documentation issues, > or any other concrete action we should take. > > [...] that brings us back to Maxim=E2=80=99s suggestion of starting a > debugger workgroup. > > Attila: > > [C]oming from common lisp [...], [I] think the lowest hanging fruit in > the guile debugging experience is making sure that backtraces are not > cut short when printed. > > [T]his is regularly causing me frustration when all i need to make > progress is in the cut off part of the backtrace, and the code in > question is in a part of the codebase that i can't easily change to > add some good old printf's. > > Joshua: > > Just my 2 cents, I always thought that the elisp debugging experince > is super user friendly and awesome! > > M-x edebug-defun RET function-name RET > > And you are golden! > > It would be awesome if guile could offer something as seemless. > > Csepp: > > Can we also get a profiler like Python's Scalene? I'm pretty sure > there are some performance bottlenecks it could help identify, both in > Guix and in Guile itself. > > -- > Olivier Dion > oldiob.dev > >