4 ms·
I mostly have experience with C/C++ but have done some CL, and I agree with GP. Check out the debugging UX (not the performance :) of Visual Studio. More specif
by HexDecOctBin 3y ago
I mostly have experience with C/C++ but have done some CL, and I agree with GP. Check out the debugging UX (not the performance :) of Visual Studio. More specifically, see how intuitive and discoverable it is for beginners.
For example, in CL debugging, how would I reliably set a breakpoint at some nested expression in a function body, run to it, and step through the code "expr-by-expr" while verifying a bunch of values in a watch window? In VS, it's one click to set breatpoint, one keypress or two clicks to run to it, one click to step to next line, and one double click and typing an expression to set up a watch that would show updated value of that expression every time execution pauses while taking care of scoping, etc.
- aidenn0 3y agoFor background: I learned C 6 years before I first started learning Lisp; I used every version of Visual Studio starting with 6.0 through .net 200X (I'd have to pull out my CDs to see which the last version I used was). Prior to that I used Borland's C++ IDE. > For example, in CL debugging, how would I reliably set a breakpoint at some nested expression in a function body, run to it, and step through the code "expr-by-expr" while verifying a bunch of values in a watch window? I ... don't ever do this when debugging lisp? Sly has support for setting breakpoints, but I'm used to adding (break) expressions; the "breakdot on the side" doesn't work as well with Lisp as C (With idiomatic C you very rarely want to set a breakpoint in the middle of a line, and it's rare for a single statement to be more than 2-ish lines; I should also note that IIRC setting breakpoints in the middle of a line in VS was not the best UX). Sly has a keyboard shortcut for stepping, but I don't have it memorized because I hardly ever use it. Conversely its F10/F11 in VS, which I still remember despite not having used Visual Studio for at least a decade, since I did it a lot! Conversely, I have the shortcuts for recompile the single file I'm in and recompile the single function I'm in memorized, since I use those all the time when debugging. I believe VS added hot-patching functions at some point near the end of my usage, but it wasn't part of my workflow like it is with Lisp. (The lack of) watch windows is a deficiency in Sly. While you can view all locals in the current stack-frame while debugging, it doesn't let you watch arbitrary expressions, and if you have too many locals it can be hard to focus on what you want. I should point out stickers (C-c C-s C-s) let you trace evaluations of arbitrary subexpressions, and this has some overlap with how watchpoints are used in VS.
- kagevf 3y ago> it doesn't let you watch arbitrary expressions You can't watch expressions, but when the debugger comes up, and I think if you're stepping through too, you can hit "e" for eval and do any expression you basically want. Any variables used would need to be in scope, etc ... (this is with sbcl and slime ... I'd bet sly supports similar)
- aidenn0 3y agoRight, but GPs comment about watchpoints in VS stands, they were accessible and easy to use, and could potentially provide value to the style of development that I use when working with CL.
- fiddlerwoaroof 3y agoIn CL/SLIME, you add `(break)` to the code where you want it to stop and hit `C-u C-c C-c`. Then you run the code you care about and you should be able to step from the break. This is a common complaint about CL, but my experience is that the utility of debuggers is vastly over-stated. It’s a nice trick in Java or C/C++ or JS (in Chrome), but I've never found a debugger to significantly improve my workflow and the “repl-driven development” paradigm of CL solves the problem differently by increasing iteration speed.
- jonathankoren 3y ago> This is a common complaint about CL, but my experience is that the utility of debuggers is vastly over-stated. It is possible to patch a running CL system by simply setting a breakpoint and then revaluating a function. I am unaware of any other language that is possible in. This Lisp feature is only made possible through a debugger. I know, because I've done it.
- _19qg 3y ago> It is possible to patch a running CL system by simply setting a breakpoint and then revaluating a function. It's also possible to change a running CL system without setting a breakpoint and/or re-evaluating a function. > I am unaware of any other language that is possible in. Start with Smalltalk and then search for more.
- fiddlerwoaroof 3y agoYeah, although the debugger in lisp is also lacking a lot of features people tend to expect: stepping through code, in particular, is painful unless you recompile with DEBUG 3
- xkriva11 3y agoThere are even languages that can do more crazy things than CL or Smalltalk. For example, in Sinclair BASIC, if you put a breakpoint at some position on the line, you can even modify the rest of the line and continue with execution from the breakpoint without the need of restarting anything.