Hacker News new | ask | show | jobs
by billfruit 1813 days ago
Does the Clojure debugger give a live Repl, where one can examine values of locals and restart execution if required, likes the elisp debugger in Emacs?
2 comments

Cursive's debugger doesn't, but as one of the other posters mentioned there's a library called debug-repl which gives you this: https://github.com/gfredericks/debug-repl.

However, as I mentioned in the article, I've found it's usually better to use scope-capture than a debugger that pauses execution. The main reason is that I mainly work with Kafka Streams atm, and when the debugger pauses one thread other threads start timing out and throwing exceptions.

That seems to give a repl at a breakpoint, I was asking about getting a repl at a point of exception. That is what elisp gives.
Ah sorry, I don't know of a way of doing that in Clojure. What I usually do is figure out where the exception was thrown, wrap that form in `sc.api/spy`, and then somehow re-execute it.
Cursive's debugger does let you restart the execution?

It's a normal step debugger, and you can run new expressions in context are we talking about lisp restarts?

I asked something similar on the Cider Github and it sounds like it's not possible to get ELisp level debugging:

https://github.com/clojure-emacs/cider/discussions/2999

If anything Clojure needs this more than ELisp b/c of the crazy error stacks and b/c of how the laziness makes things blow up in all sorts of weird places