Cursive vs Cider

I honestly wanted to try Cursive - because I don’t believe in #EmacsAllTheThings but it ends up that only my terminal and web browser is keeping against…

So about my experience: maybe this was lack of my knowledge, but coming from Common Lisp world and being very REPL-oriented in development I was instantaneously frustrated.

  • REPL is nothing like in Emacs. Seems like raw text buffer, difficult to work with.
  • Keyboard shortcuts are painful, there’s no something like C-c C-c in emacs to compile current defun.
  • CIDER has good enough stepper-debugger, totally necessary with Clojure’s lack of meaningful error messages (cider-eval-defu-at-point with universal-argument in emacs (C-u C-c C-c). I’ve found nothing nearly as convenient in Cursive.

I’d love to use some well supported, OOTB environment different than Emacs. But I know none. Probably LightTable was the closest, I like it’s idea - but it’s de facto dead with deprecated dependencies (like old Electron).

Maybe you have any other ideas?

2 Likes

I’d like to add to @colinfleming’s answer that if you use the Webstorm/Ultimate IDE (paid) that comes with very good JavaScript support, you get full IDE support for it, which is very useful for mixed CLJS/JavaScript projects. You even get Google Closure support, as it understands goog.provide/goog.require, JSDoc etc. out of the box. In my project where we do CLJ/CLJS/JavaScript with some interop with Java and JS it’s very useful.

2 Likes

I haven’t found that to be the case, but then again I don’t normally write directly into the buffer, instead I tend to write in (comment ..) blocks and send sub-forms to the REPL.

They’re completely rebindable, and the one I normally use for this is “Send current top-level form to REPL”. It can be found by searching the Keybindings in InteliJ. I have it bound to CTRL-backtick as that’s much simpler than two key combinations.

However, the one feature Cursive has that Cider doesn’t (at least as of a few months ago), is the ability to send a top level form to a REPL ignoring the top level comment. As mentioned I put my REPL code in (comment (println ...)) format. Highlighting the println and “send top level form to REPL” results in sending the println since Cursive assumes there’s no reason to send the comment.

Cursive uses InteliJ’s debugger and adds quite a few useful features. You have to start the repl in debug mode (although that should be true for any JVM process), and from there you can use the common IDE keybindings of F8-F10 to step over, into, or out of functions. I don’t use the debugger much, as I rely mostly on the REPL for debugging, but every time I’ve needed it, the Cursive Debugger has done the job.

So maybe take a look at it again sometime. Maybe things have changed since you last looked at the IDE. Cursive absolutely fills that role of “it just works” Clojure editor.

1 Like

The “just works” is what I had hoped for when I brought in a Windows-operating student to join us on a Clojure project; unfortunately, two hours of attempting setup and he couldn’t get IntelliJ working; getting Lein, Git, and java versions all to work seemed prohibitively difficult

Doesn’t intelij come with git, and Cursive comes with lein? I’ve done this setup several times, and it’s Install JVM (may not even be required these days), install Intelij, install cursive plugin.

That being said, Windows is just crap for non-MS development. Python, Java, Ruby, PHP, Haskell, Erlang, I’ve worked on all of those in Windows and they’re all insanely painful to setup.

1 Like

I use Emacs on my Linux box, but at work I have Windows, so I fallback to Cursive. I tried to replicate the same environment I have at work at home, but I had issues with Cursive on Linux (I really don’t know why).

So my experience was: lots of pain to learn and configure Emacs (now I love it, but that’s another story) on Linux, really easy to get Cursive to work on Windows (for Emacs is the exact opposite, I can’t get it to work) but not working on Linux.

Cider’s approach is just to eval those sorts of things inline, instead of sending them over to the REPL. I do the comment form thing too (since seeing David Nolen doing it in a talk): I just stick my cursor right after the form I want to evaluate and run cider-eval-last-sexp (bound to C-x C-e by default).

It shows me the result of evaluating whatever it was inline, don’t have to switch buffers.

Like this:

cider-eval-last-sexp

1 Like

Oh, and it looks like there’s cider-insert-last-sexp-in-repl (default C-c M-p) to copy the form over to the REPL instead of evaluating it inline.

1 Like

Emacs was my first editor, and I spent 10 years in it, but having switched to Atom, and now having switched to Cursive, I’d say the biggest thematic difference is that I only use a handful of keyboard shortcuts now and instead rely heavily on the apropos command. I find a single keyboard chord followed by a quick search to be more ergonomic than the emacs way. Keyboard shortcuts do exist for the things I use often and can be customized easily, but the huge chunk of stuff that I only use once in a while is easier to get to in Cursive (and Atom).

I’ll also echo the “Just Works” aspect of Cursive along with the pleasure of high-quality static analysis. (My only real complaint is that Cursive still doesn’t understand javascript interop and creates lots of linter noise.)

2 Likes

Yeah, I know some people like that, but it really bugs me how Cider tries to hide my REPL history. It’s REPL driven development, not buffer driven development. Once that in-line text gets removed (for whatever reason) how do I get it back? And now I have the mental overhead of knowing what text is real, and what is overlaid by the IDE. Same issue with Lighttable, btw.

3 Likes

@Timothy_Baldridge
There is a pretty good explanation of how to fix this issue here:

2 Likes

also, hit , in the repl and it will pop up a browser of the entire repl history. But I agree I really like the cursive take on repl. You opened a ticket on github about this idea and hopefully it’s been useful to you since.

1 Like

Have you heard about http://spacemacs.org/ ? Like everyone I’ve also spend^Wwasted part of my life maitaining „the perfect .emacs”, but years ago I’ve switched to spacemacs which defaults are good enough so it suites me. Even more, I know people who drop their .emacs after like twenty years of building!

So in Spacemacs clojure is literally one line. Just add clojure layer and restart. That’s all.

Give Spacemacs a try! Don’t expect it to be exactly as you’d like, though. Although, some time ago I’ve discovered that it’s easier to change my expectations and habits rather than maintain all of my environments on my own.

PS: Just giving Cursive one more try!

1 Like

I can try it, let’s hope the proxy won’t complain too much with it :grinning:

That’s unfortunate. I can’t help with all of that, but if he stops by #cursive in Clojurians or the Cursive mailing list I can help him out with the IntelliJ part at least.

My getting started doc is woefully incomplete and out of date so it doesn’t mention this, but Cursive will actually use the JRE installed with IntelliJ by default if you don’t have any other set up - it’ll be called “IDE SDK”. It’s a 1.8 JRE with tools.jar (not a full JDK but most of what you need, and all you need for Clojure) which is usually plenty to get started with. Cursive will also download the lein uberjar automatically, so it will also work within Cursive with no setup. To use lein on the command line you’ll need to go through the Windows lein setup to get the script installed, and I believe that can be funky, yeah. But to be honest, I don’t drop out of Cursive to lein much, Cursive’s support is pretty complete.

Sadly I know nothing about installing git on Windows, so I can’t help there.

Thanks for the kind words, I’m glad Cursive is working well for you! JS interop can be a pain, yeah - I’m planning to fix the highlighting in the short-term, and improve the JS indexing so that type inference can do more in the long term. Sorry this is annoying in the meantime.

That is probably true.

This is definitely not true. One thing that can be confusing for newcomers to Cursive is that the REPL pane is split into separate input and output sections - see the animations here. In particular in the dark theme the division can be hard to spot, and for some reason the input pane appears collapsed for a very small number of users. But mostly it’s just slightly unfamiliar so they’re not sure what they’re looking at.

The output pane is indeed just raw text (because, well, that’s what output is), but the input pane is a fully-featured editor.

There is Tools->REPL->Send top form to REPL which I think is what you are looking for. You can rebind all the keys to whatever you like.

As @tbaldridge stated, Cursive has a full debugger - see “Starting a debug REPL” on that page. It’s subject to some limitations that I discussed above, if you’d like a better idea of how it works check out my Clojure/West talk, which was more or less a 40-minute demo with a lot of discussion of the advantages and pitfalls.

4 Likes

I guess as CIDER’s author people would expect me to say something here as well. :slight_smile:

At this point, however, I’m sick and tired of trying to compare the benefits of different editors and IDEs, so I’ll be really brief:

  • Emacs (and CIDER) is a good choice for you if you want to create a programming environment that’s uniquely tailored to you and you’re into tweaking and fine tuning everything (remember Gentoo Linux?). That will require some serious time investment, though. It took me years to really grok Emacs and to be able to bend it to my will. Then again - you’re likely smarter than me. :slight_smile: f you just want something that works out of the box probably Cursive is your only option these days (to my knowledge CCW and LightTable are effectively dead).
  • CIDER’s obviously open-source, so all of you can help with the development. I’ve spoken a few times about this in the past - everything (cider-nrepl, orchard, refactor-nrepl, cljs-tooling, etc) except the Emacs UI is reusable tools and libraries and every improvement to them benefits most Clojure editors out there. Even vim-fireplace users those internally. :slightly_smiling_face:

For more details - just take a look at some of my “philosophical” talks listed here http://www.cider.mx/en/latest/additional_resources/

6 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.