8 ms·
Programming Clojure applications with CIDER[0] is a really slick experience. By connecting through an nREPL port to a running environment you can capture variab
by mbil 9y ago
Programming Clojure applications with CIDER[0] is a really slick experience. By connecting through an nREPL port to a running environment you can capture variable values like function inputs, change and re-evaluate function definitions on the fly, and test hypotheses by calling funcs directly with whatever input you want. Not to mention the speed of prototype iteration. This has been invaluable when trying to quickly track down production bugs.
I've lately been working in Python, and even with IPython/Juptyer the workflow isn't quite as magical as Clojure's.
[0]: https://github.com/clojure-emacs/cider https://github.com/clojure-emacs/cider
- pimeys 9y agoI've been working with Clojure a lot and some years already, but only a couple of months ago really started working with CIDER. It makes everything so much nicer and it feels like the way Clojure is meant to be developed. I had some grudges about leiningen and the startup speed, but having a CIDER connection, tests ready to run immediately and a REPL where I can test my code in a buffer, writing Clojure is such a joy.
- kimi 9y agoIf you're not into Emacs, IntelliJ has a sick integration that works through a nREPL called Cursive that is a joy to use https://cursive-ide.com/ https://cursive-ide.com/
- swlkr 9y agoFellow Cursive user here. Being able to hit a key, in my case Shift + CMD + P while the cursor is on some text and to see it live in the REPL is pretty incredible. It’s also kind of weird that a lot of other languages do not have this
- dolzenko 9y agoJust a reminder to younger crowd Visual Studio had all this before (packaged in single app hence well-integrated and easy to install) probably for 15 years or longer.
- hashkb 9y agoAre you trying to say the "younger crowd" is on Emacs and doesn't know about Visual Studio?
- shoover 9y agoAre you referring to the VS debugger and msvsmon? The VS debugger is an excellent tool, but stopping the world each step is different than how the Clojure REPL setup described by the parent works. Did/do people really develop applications interactively in VS other than in F# Interactive? I've been using VS a long time for VB6 and C#, only in edit/compile/execute-debug mode.
- zeveb 9y agoInteractive Lisp development with Emacs has been around longer than that. The first commit for SLIME, which is a (third-generation, I think) Lisp development environment for emacs, is from September 2003: https://github.com/slime/slime/commit/2fb4c4e53b59ed7b6e5f55780574a1016c0e5074 https://github.com/slime/slime/commit/2fb4c4e53b59ed7b6e5f55... (and the comment implies that there was development before then). Visual Studio has been around since 1997 (which is pretty cool!). Emacs has been around since 1976, although I don't know how far back it got a decent Lisp development environment. Early 80s, maybe?
- lispm 9y agoInteractive REPL in Lisp: early 60s. Interlisp development environment: early 70s. Interlisp-D: Early 80s. MIT Lisp Machine + Zmacs: end 70s. Macintosh Common Lisp, LispWorks, Allegro CL, and many others ...: mid-end 80s. GNU Emacs based Lisp development: end 80s.
- marmaduke 9y agoRe Python, PyCharm is one of the most slick experiences, supporting everything you mentioned. That said I find IPython supports everything you’d want to do in Python save multithreaded profiling for which Yuppi is useful.
- petagonoral 9y agoAs he rarely asks for donations, I feel it only appropriate to mention the author of Cider (& Rubocop for Ruby people) has a patreon if anyone is feeling generous & feels the above (free) tools adds value in their lives: https://www.patreon.com/bbatsov https://www.patreon.com/bbatsov Sadly, it's only at $31 per month
- billfruit 9y agoBut does it allow you to examine stack and local values when an exception occurs, I wasn't able to do so last time I tried a few months ago. Also the cider environment is kind of brittle with seemingly lots of components, all of whose versions needs up to align for the magic to work. And another issue with clojure and leiningen is the almost impossiblity of using local jars as dependencies, without setting up local maven repositories. Too much work for what I was doing for fun.
- sgrove 9y agoMight be worth mentioning gumshoe[0] as well, which is fantastic. I use it to capture bindings without thinking about it (using the automatic plugin for development mode - no overhead for production!). Often times I run a long-ish/effectful function (web request, network request, etc.) and wonder what the value was somewhere in the function, but unfortunately I didn't have the foresight to do a (def -my-value value) ahead of time. With gumshoe, it's all automatically captured, so I can pop the values into my repl and play with them to understand what happened. A few examples: user> (deft add-ten [num] (+ num 10)) #'user/add-ten user> (add-ten 2) 12 user> -add-ten-num 2* user> (deft destructure-example [{:keys [a b] :as args}] a) #'user/destructure-example user> -destructure-example-a 1 user> -destructure-example-b nil user> -destructure-example-args {:a 1, :c 2} Anyway, it's quite surprising how often this saves my bacon. And it pairs very nicely with cider indeed! [0] https://github.com/datodev/gumshoe#gumshoe https://github.com/datodev/gumshoe#gumshoe