← Back to context

Comment by klibertp

7 hours ago

My bad, I mean source-level debugger. Something that allows you to step through forms as they are in the source, unexpanded and not decompiled. It should allow jumping to a line or over an expression, continuing to a point, seamlessly stepping into subroutines, and stepping out of expressions. It would be nice to have single-activation and conditional breakpoints. Variables in the executed portion of the code should be annotated with their values. Sometimes watchers - forms auto-evalled in each frame - are helpful, though these are implemented in some CLs, IIRC. SLY's stickers are close, but they are gathered during execution and replayed later, so the break-edit-recompile-redo workflow doesn't work with them. My experience debugging CL using SBCL and SLIME reminds me of debugging CoffeeScript in a browser before source maps were a thing... It's still 100% doable, just less convenient.

Cool, I'm assuming this is largely driven by mouse usage, as well?

I'm always baffled by how long it has been since I was used to step debugging. It was definitely something that was huge when I was learning, but seemed to get left behind by so many practices.

My general memory is that it was growing and the likes of JRebel were aiming for very powerful uses of debugger connected development experiences. Eclipse, as I recall, have their own compiler specifically to let you debug code that isn't completed. Then, cloud technologies largely came and many just lost track of what could be done.

A fun example, I remember senior engineers at Amazon that didn't know you could hot patch Java while step debugging. Something that they had largely never had a chance to do, because of the standard deployment processes they had been used to.

To the direct point, I am somewhat surprised these aren't doable in Common Lisp. I saw examples showing these years ago, just without the GUI affordances that were in some of the other IDEs. https://malisper.me/debugging-lisp-part-5-miscellaneous/ has examples of the trace command offering conditional breaks and such. Sounds like there is the functionality, but lacking the visual cues/affordances?

  • > Sounds like there is the functionality, but lacking the visual cues/affordances?

    Yeah, some things are missing (arbitrarily moving control to a given line (even if it precedes the current one) in a function, stepping into some functions[1]), but mostly they're there, just clunky to access and view. It's getting better, though - I checked the cookbook page[2] and found a project[3] that I didn't notice previously, which should help quite a bit with convenience. Even with that, though, LispWorks[4] still looks better... ;)

    [1] The ones compiled with a low `debug` setting; they're either impossible to step into, or you land in the decompiled source. Trying to step into a function call should recompile that function automatically with debug instrumentation enabled.

    [2] https://lispcookbook.github.io/cl-cookbook/debugging.html

    [3] https://github.com/mmontone/slime-breakpoints

    [4] https://www.lispworks.com/images/lw-ide-cocoa.png

  • One of the reasons I kept around Java and .NET ecosystems on my toolbox, regardless of their lack of coolness by modern coffee shop coding standards, is exactly the traces of Smalltalk/Lisp development experience that somehow are part of the tooling and runtime capabilities.

    By the way, it is relatively easy to plug a debugger into a running container in a Kubernetes pod.

    Yeah too many folks pretending their systems are UNIX in 1980's, and not aware of what is available.