IRC channel logs

2025-04-06.log

back to list of logs

<ieure>Is there an easy way in the Guile REPL to return to the top level when dealing with nested errors, or do I just have to keep hitting ,q until I get there?
<dsmith>C-d also works
<skeemer>is guile development like common lisp ? i mean image-based? i was searching for an image-based development scheme, like with resumable exceptions and so on...
<ArneBab>dsmith: I’d also like to have a way to return to top-level, because I’ve sometimes stumled into hitting C-d once too often …
<ArneBab>⇒ arg, all state gone!
<ieure>Yes, I've done that more than once :(
<ieure>,qq or ,q0 or something like that would be super helpful.
<ArneBab>yes
<ieure>I often get into this situation when I C-c C-k to load a file, which reports errors, which I then fix one by one. But that leaves me nested N levels deep.
<ArneBab>skeemer: you have resumable exceptions, but I do not know a way to save and reload an image.
<ArneBab>ieure: same for me, yes …
<ieure>I don't think Guile supports saving/loading images like other Lisps, because of its focus on embeddability into other programs. Happy to be wrong about this, though!
<ArneBab>I don’t see a way to quit all promppts with ,q¹ or directly (quit)² — I guess this would first need a new procedure that quits all, and then a meta-command could be added that does the same. ¹ https://www.gnu.org/software/guile/manual/html_node/Processes.html#index-quit-1 ² https://www.gnu.org/software/guile/manual/html_node/Interactive-Debugging.html
<ArneBab>I don’t see how to do that right away, so I think you may have to look at the implementation of (quit).
<ArneBab>ieure: see ./module/ice-9/boot-9.scm:3724:(define (quit . args)
<ArneBab>If I see it correctly, that defers to ./module/ice-9/boot-9.scm:1764: (define (throw key . args)
<ArneBab>it does (throw 'quit) ⇒ need to find where 'quit is handled.
<ieure>Would either need to have ,qq (throw 'quit-all) and have the toplevel have a handler for that; or (throw 'quit 'top-level) and unwind until the toplevel is reached.
<ieure>I have no idea how this actually works, just guessing here.
<ArneBab>ieure: the info you need seems to be (length (fluid-ref *repl-stack*))
<ArneBab>See ./module/system/repl/repl.scm:172: (if (eq? k 'quit)
<mwette>repl quit takes an exception path. The *repl-stack* has all the stacks and you could get the top one, but how to continue from there escapes me. You can get the most recent frame and the pointer via frame-address, but how to feed that to the vm.
<mwette>^ still seems kludgy
<ArneBab>yes, but it’s a start.
<ArneBab>ieure: if you get a ,qq written, I’ll gladly review. Should I not answer within a week in the mailing list, please ping me here!
<ieure>ArneBab, Pretty far down on my list of stuff I want to work on, but maybe.
<mwette>A simple way might be to write hook for vm-add-abort-hook! where if you're not at the top of *repl-stack* you (throw 'quit)
<skeemer>ArneBab: i am searching for a scheme implementation that gives kind of the same experience as common lisp...
<ieure>skeemer, #lisp might have some suggestions.
<skeemer>i will try but do not have high hopes
<ieure>Haven't really used it, but probably Racket is your best bet, as it's the other fairly mature implementation.
<shawnw>If you want a Common Lisp experience, you should just use Common Lisp.
<trannus_aran>anyone have recommendations on a CI/CD setup for guile?
<tomenzgg>trannus_aran: never used it so I really can't help with the actual setup part but I do know that https://codeberg.org/jjba23/byggsteg exists.
<trannus_aran>tomenzgg: ooo, thank you! this is very cool :) love seeing all the guile rep on codeberg ^-^