Meta Redux: CIDER 2.0: Sky is the Limit

Wait 5 sec.

Two weeks ago I wrote that CIDER 2.0 was brewing. Today the brew is ready -CIDER 2.0(“Terceira”)1 is officially out! I promised the release would follow thepreview within a week or two if nothing serious surfaced, and for once in mylife I’m actually on schedule.The preview post covered the big themes in detail - thetransient menus, thecall-graph browsers,cider-macrostep,the revamped tracing andenlighten, theClojureScript improvements - so I won’t rehash all of that here. Instead I’llfocus on what changed between the preview and the release, and on the biggerpicture of what CIDER 2.0 is actually about.What CIDER 2.0 is aboutLooking back at the (enormous) changelog, the release boils down to four themes: Tackle some ambitious ideas that had been lying dormant for ages - inlinemacro stepping, rich (content-type) results, source-aware cross-referencing.Some of the issues closed by this release were filed the better part of adecade ago. Polish the “understand your code” toolbox - the debugger, the macroexpansionfacilities, tracing, enlighten, the stacktraces and the cross-references allgot a serious amount of love. Make the whole CIDER experience more consistent and discoverable - transientmenus everywhere, one tree-view widget shared by all the browsers, and anaming cleanup that brought a bunch of stragglers in line. Fix old annoyances - the friendly-session complexity that 1.22 started taming(remember the redisplay lag fixand default sessions?), the find-references gaps, the flaky SSH tunnels, theconfused stdin handling.Notice what’s not on that list - a pile of shiny new features. There are a fewgenuinely new things in 2.0, of course, but the heart of this release is thatmost of CIDER’s important features got overhauled (tastefully, I hope) or mademore robust and faster. After 14 years you accumulate a lot of good ideas withrough edges; 2.0 is me going over them with fine-grit sandpaper.What landed after the previewQuite a lot, as it turns out - the last two weeks were busy. The headliners: Rich resultsare now on by default. Evaluate something that returns an imageand it renders inline; a result that points to external content (a file, aURL) gets a [show content] button that fetches it only when you press it.HTML renders as formatted text, URLs are clickable. This works for regularC-x C-e-style evaluations too, not just in the REPL (configurable viacider-eval-rich-content-destination). Fun fact: content-type support wasadded way back in 0.17, disabled in 0.25after it got a bit overzealous with the fetching, and the interactive-evalpart was requested in 2018.Better late than never, right? The transient story got finished. The debugger and the inspector now havemenus of their own (? and m respectively), and many menus grew argumentflags - pick a pretty-printer per invocation, set test selectors once andreuse them across runs, toggle the refresh modes, pass aliases at jack-in.As before, your muscle memory is safe - the menus only help when you pause. There’s a new cider-doctorcommand that checks your Emacs setup and youractive session for common problems (version mismatches, stale byte-code,leftover obsolete config) and produces a copy-pasteable report. My hope isthat it will make “CIDER doesn’t work” bug reports a thing of the past - orat least give us something to look at when they arrive. Pending evaluations now show an animated spinner overlay right at the formyou’re evaluating, instead of a spinner in the mode-line of a REPL buffer youprobably can’t even see. The debugger gotdusted off properly: quitting a debug session finallyrestores point to where you started - an issuefiled in 2016 - theforce-step-out key works again, and cider-nrepl 0.62 fixed a batch ofinstrumentation bugs (records surviving instrumentation, clear errors forforms too big to instrument, and a few crashes). Stdin handlinggot a long overdue overhaul - input prompts are routed to thesession that actually asked for input, cancelling a prompt now interrupts theevaluation (instead of quietly letting it continue), and C-c C-d sends EOFfor code that reads until end of input. Clicking a stack frame for a top-level anonymous function now jumps to theactual source instead of clojure.core/fn - a bugfrom 2020 - andClojureScript frames render their ns/fn properly. A big consistency pass over the options: the REPL history browser is nowcider-history, the inline-result options became a coherentcider-eval-result-* family, and the six per-buffer auto-select optionscollapsed into a single cider-auto-select-buffer. Every old name keepsworking as an obsolete alias, so nothing breaks. And a long tail of robustness work - a slow memory leak on theeldoc/completion path, cider-classpath on Windows, formatting no longercorrupting multi-line strings, theme-aware colors for the nREPL message log,and plenty more of the same ilk.The documentation also got restructured to be more approachable - there’s aproper quickstart now, akeybindings reference page,dedicated pages on using CIDER alongsideclojure-lsp andclojure-ts-mode,and a guide forfull-stack Clojure + ClojureScript projects.The manual has grown organically for over a decade, and it showed; hopefullyfinding things is much easier now.UpgradingDespite the big scary version number, upgrading should be uneventful. All therenames ship with obsolete aliases, the transient menus preserve the classickeybindings, and the only removals are commands that had been no-ops for years.The one bit of muscle memory you may need to adjust: cider-macroexpand-allmoved from C-c M-m to C-c M-m a, as C-c M-m is now a prefix for all themacroexpansion commands. If anything feels off after the upgrade, M-xcider-doctor is your friend.Fourteen years laterCIDER 0.1 (well, nrepl.el 0.1) was released on July 10th, 2012 - fourteenyears (and five days) ago.2 I’ve been reflecting on this a lot lately.Fourteen years is an eternity in our line of work - entire ecosystems have comeand gone in that time - and yet here we are, still innovating, still improving,still moving forward. I dare say CIDER 2.0 is the strongest release in theproject’s history, and it’s certainly the one I’ve enjoyed working on the most.3None of this would have been possible without the people and organizations whohave supported the project over the years - everyone who contributed code,reported issues, wrote about CIDER, answered questions, or backed the projectfinancially. A special thanks to Clojurists Togetherfor their long-standing support, and to everyone who took the snapshot for aspin after the preview post and shared feedback - several rough edges got fileddown because of you.So, go play with CIDER 2.0! Kick the tires, explore the menus, crack open somevalues in the inspector,step through a macro or two. And if CIDER makes yourwork a little nicer every day, consider supporting its future development that’s what keeps CIDER and friends going.Where to from here? The sky is the limit. The REPL is the inspiration. The best is always yet to come…Keep hacking! Continuing the Azores naming streak started by 1.22 (“São Miguel”).“Terceira” literally means “the third” in Portuguese, which is a slightlyconfusing name for a 2.0 release, but naming things has never been mystrong suit. ↩ The full origin story is in CIDER Turns 10, if you’re curious how a prototype hacked ona flight to San Francisco ended up here. ↩ That I can remember. My memory is not what it used to be. ↩