Fancy Clojure REPL
asciinema.org
asciinema.org
They're pretty terrible compared to what was available in Lisp machines and Smalltalk (for example) from decades ago and what now live on in McCLIM's Lisp Listener https://common-lisp.net/project/mcclim/excite.html and Pharo Smalltalk Playgrounds.
The main problem is the Print part results in "dead text". For example, you can't re-select it (other than using history shortcuts), you can't interact with it (it's dead, afterall) and there was only one representation of it (some kind of "to-string" for it). You can't even inspect it.
Beyond that, you're stuck with the teletypewriter environment. You can't display an image, or sound wave, statistical model graphically etc, let along interact with them.
Caveat: I don't use Calva myself, but I'm the president of the Clojurists Together Foundation. We just funded Calva's development and of course did some due diligence in the process. It's definitely got a ton of features, it's stable, but it's maybe slightly less feature-complete than the CIDER ecosystem right now. Hopefully funding helps change that, I'm a happy Emacs + CIDER user but rising tides lift all boats :-) One thing I love about Calva is that there's less fiddling. You just turn it on and you get 99% of the actual functionality of a top-end Emacs setup, except you didn't spend hours getting it to actually work. (Spacemacs makes this a lot better, but not everyone uses Spacemacs.)
While Calva isn't CIDER, it does build on stuff that is either directly from CIDER or de facto from CIDER (e.g. nrepl), so fortunately there's a lot of development effort that directly or indirectly helps both projects.
Finally, the shameless plug: if developing the Clojure ecosystem is important to you you should consider giving us (Clojurists Together Foundation) money -- we've funded critical infrastructure like CIDER, fireplace, Ring, Reagent, shadow-cljs... Oh, and we keep a little thing called Clojars afloat :-)
I will definitely give you folks some money for that. Thank you for making it a thing! :- )
I would never say that you can't use Calva to get work done, but CIDER has a good deal more than what Calva offers currently.
I could accept that maybe "99% of users don't need what CIDER offers", but saying that Calva is 99% of what CIDER offers is just completely incorrect.
The big culprit right now is that Calva doesn't handle large results well at all. I find strategies around it, but it is a thing that really needs to be fixed and it will be in focus during the Clojurists Together funding.
Another feature lacking, that CIDER has, is a step debugger. Something that doesn't affect my workflow very much, but I know some people will lack it. It is also part of what we will try to fix during the CT funding period.
I have to say that there are 3 things that I am very grateful for acquiring in 2019: got into Bach's music, learn to play the piano and finally "got" LISP via Clojure.
For a long time I ran venantius/ultra but too many of the dependencies ended up randomly breaking stuff. These deps look a little less likely to do that so I'll give it a shot :)
(set/union a b)
it will auto add the set namespac, it has history etc. Supports paredit.It will also do some autocomplete, although this seems flakey.
The two most common ways I've seen people accomplish something like that is probably Clojure's builtin inspector functionality and CIDER's general ability to display any kind of image (which conveniently lets it do stuff like plotting as well). If your focus is on the permanence and documentation aspect of the notebook experience, you're probably going to be happier with ob-clojure or Gorilla REPL. If your focus is on the exploratory part, you're probably going to be happier with REBL, or if you really want everything inside an emacs buffer you might do that with walmartlabs' datascope. I do everything with cider-inspect because I don't find the graphical visualization that valuable -- most of my data structures are too large so I ~always end up writing a specter query ~immediately.
All of this is for Clojure specifically. If you're writing in-browser apps you'll probably like frisk (through re-frisk or data-frisk), where you can do this stuff right in your browser next to the app:
http://odinodin.no/x/datafrisk/
https://github.com/flexsurfer/re-frisk
-- but that's not technically in CIDER, though you can certainly use it from CIDER.
[0]https://clojure.github.io/clojure/clojure.datafy-api.html [1]https://github.com/cognitect-labs/REBL-distro
And clojure pretty symbols.
Can you explain this point. Is it possible that you might have forgotten to sync the new code with the repl. Editor and repl use different completion backends in cursive.
I kind of hold the same opinion. Being more powerful, feature-rich, flexible than readline implementations, editors are, by design, more suited to editing forms. And, I believe, “sending forms from your editor to the REPL” is what the “REPL-driven development” encourages.
> I almost never type directly in the REPL, even when I have it in my IDE
I agree that it's more comfortable to be able to send forms from your editor to be evaled somewhere else, I myself don't use the CLI REPL very much, but since I use vim-fireplace, I guess my REPL is in the terminal anyways.
Since it wasn't clear in https://news.ycombinator.com/item?id=22193862 what language iLemming uses or have experience with REPLs, I just wanted them to clarify.
As for Python, https://visualstudio.microsoft.com/vs/features/python/
Naturally Clojure based IDEs like Cursive are also quite nice.
In Clojure, if you have something like:
(foo [a b] ((c a) b))
you can evaluate every single part of it, you'd get immediate feedback, what is `a`, what is `b` and `c`, the result of `(c a)`, the result of the entire thing, etc. Similar thing in JS would be something like:
let foo = (a, b) => { return c(a)(b); }
It's already more difficult to edit, there's no "structure", it's not easy to evaluate arbitrary pieces without "dancing around", introducing temp variables. Given Clojure code snippet is also data, it can be send over the wire, send directly to the connected REPL instance, etc.
That's what gives Lisp developers a substantial speed of development. When people talk about "what's good about Clojure", they usually say: immutable data-structures, stability, hosted nature - can target JVM, JS, BEAM and CLR, can even have interop with Python and R. But the coolest thing about Clojure and Lisps in general - they provide "true" REPLs.
Edit: or maybe you responded to the wrong comment?
You can certainly eval parts of a python or ruby program (although indentation-as-block needs some care in python).
In lisp you also need a useful scope (eg: if foo isn't bound "(foo 1 2)" won't be very useful).
edit...
I think I'm seeing that your question is more of a point that you're making. Yes, it's nice to be able eval from the editor, but now being a professional Clojure developer after having been a Python developer for years, I would agree with the arguments that typing lisp (s-expression) code in a repl is much easier than Python, because you don't have to worry about indentation. This probably applies to other languages for different reasons. eg. Java... I can't even imagine what a REPL would be there. My repl usage in python was usually just calling a function I wrote in the editor. Same with my little experience in Ruby.