4 ms·
Clojure Debugging: Emacs, nREPL, and Ritz
- mark_l_watson 13y agoGreat write up. I use IntelliJ for most of my Clojure dev work, but I do like nREPL and I am using Ian's setup notes to improve my setup. BTW, I started using Clojure years ago because of Ian's influence - that is what I used on his projects. I used to be firmly in the Common Lisp camp (and used to use Ian's Elephant CLOS database wrapper) but I have mostly stopped using Common Lisp and Scheme in favor of Clojure.
- mattdeboard 13y agoI never start lein repl at the command line anymore, M-x nrepl-jack-in is sufficient. Does lein repl give you something extra?
- jamii 13y agoIf you use lein repl and emacs crashes, your repl will stay up and you can reconnect to the same session. Yeah, I crash emacs a lot...
- jamii 13y agoAlso, if you run a command that prints a lot to stdout (eg tracing) it will make emacs unhappy. That works much better in the lein repl terminal.
- weavejester 13y agoI tend to start the repl at a command line and then connect in. That way my repl session isn't tied to the emacs process, and if I do something stupid in emacs I can disconnect and reconnect without issue.
- ianeslick 13y agoI do ALOT of remote diagnosis / inspection / debugging. 'lein repl' just makes my local workflow similar to my remote workflow (via ssh tunnels). I'll second the value of having a separate buffer with all the tracing data dumped out to it vs. showing up in Emacs.
- WildUtah 13y agoTo get most of the benefits of this in Vim, try Vim fireplace. https://github.com/tpope/vim-fireplace https://github.com/tpope/vim-fireplace Everything you want but the debugger. You'll have to get Ritz on its own for that. I usually develop with clojure code on Vim in one terminal window and a repl running in another terminal. It's really nice to have them working together in the background with nRepl and Fireplace. I wrote a nice hack so that line numbers and file names in stack traces are useful in functions I've updated in my files over the nRepl transport.
- akurilin 13y agoVim fireplace is fantastic, kudos to tpope for putting that together. I haven't tried debugging with it yet, but it sounds like it should be pretty doable.