Fork me on GitHub
#cider
<
2018-02-18
>
richiardiandrea01:02:57

@dpsutton yeah well you might say that they essential do the same thing, except that cider exposes functionality by hijacking the main medium of communication and wrapping in bencode while inf-clojure does not. With orchard out now in theory inf-clojure could call those functions directly.

dpsutton01:02:31

i was thinking of the cider-nrepl middleware. inside of the that we can do quite a bit of reasoning that isn't exposed by a repl

dpsutton01:02:16

i like inf-clojure specifically for not putting anything additional into the project. no dependencies, just clever interaction with the repl

richiardiandrea01:02:20

At some point you need deps for more complicated features, one solution is to load them server side..

richiardiandrea01:02:29

unrepl loads them from the client instead, which is very interesting...sending a packaged up payload that gets evaluated repl side and adds functionalities

bozhidar12:02:46

@dpsutton Old versions of CIDER didn’t use any middleware and were just evaluating some complex snippets of code to get stuff down, but although as a client this seems simple, it’s both extremely brittle and extremely hard to maintain after a certain point.

bozhidar12:02:02

Any complex editor support requires a ton of logic and you need to put it somewhere. Whether you’re upgrading an existing REPL and you setup a special REPL doesn’t matter that much in the end of the day - in both cases you needed someone to augment what the REPL can do so, so it’s actually useful to the editor/whatever.

bozhidar12:02:13

In general if people are happy with the feature set of the inf-clojure they should probably stick with it, as it was created with simplicity in mind. If you end up needing more features (e.g. tracing, debugging, whatever) you’ll need CIDER.

bozhidar12:02:42

I do hope that CIDER will get to a point where we’ll support REPLs like lumo and planck, but that’s not going to happen any time soon as first we need to implement some support for socket repl and then reconcile the differences between hosted and self-hosted cljs repls.

bozhidar12:02:46

And to answer the original question…

bozhidar12:02:48

> Hello what is a status of cider? Will it be abandoned in favour of inf-clojure?

bozhidar12:02:52

Never. 🙂 I’ve always viewed them as complementary projects, otherwise I wouldn’t have created both of them. I guess it’s time for me and @richiardiandrea to finally created some comparison table for them and extend the readme to answer some of the FAQ regarding the differences between them.

ghadi14:02:58

Is it possible to have inf-clojure use two connections so that *1 doesn't get lost in a repl?

richiardiandrea16:02:56

@ghadi can you give me an example of what you would like to have, I don't quite get it 😄

ghadi16:02:32

When completion queries run, you lose the previous contents of *1

ghadi16:02:48

If user-submitted forms and inf-clojure submitted forms were on different sockets, there would be no problem

ghadi16:02:13

*1 is thread local

Karol Wójcik16:02:16

Thanks @bozhidar for the answer. 🙂

richiardiandrea17:02:43

@ghadi I see now, so inf-clojure shouldn't probably care about this problem, as you know unrepl keeps a session. If I had to add support in inf-clojure I would basically a inf-clojure-cmd-preamble that executes some session saving code each and every command. Other ideas and an issue open are more then welcome ;)

richiardiandrea17:02:20

Also, the completion command is completely configurable so you can wrap it in custom code, I think there is an example in the code base

dpsutton17:02:54

can you do session saving code like that? can you tell a repl not to let this expression clobber *1?

dpsutton17:02:21

CIDER gets around this by running two sessions to each repl. there's a tooling session alongside the user session

richiardiandrea17:02:42

Yes that is the classic approach inf-clojure does not have

richiardiandrea17:02:13

So @ghadi if you use the socket repl, probably a wrapper could get stored session data

ghadi17:02:43

That last point I don't follow

richiardiandrea17:02:10

If I understand correctly the socket repl stores the *1, but I am not 💯% sure

richiardiandrea17:02:35

I would need to try that out on mobile now

ghadi17:02:57

On mobile too

ghadi17:02:22

Socket repl doesn't do anything special than the Clojure main repl

ghadi17:02:14

*1 2 3 are dynamic variables that are freshly bound for every repl connection

ghadi17:02:32

inf-clojure doesn't have to save any session state at all

ghadi17:02:15

I think separating into a command stream and a user stream is useful - the preamble idea is a hack (sorry)

ghadi17:02:51

I wonder how hard that would be - I'd love to try writing some emacs lisp for once :)

ghadi17:02:17

Both repls would operate in the same way

ghadi17:02:39

Just have to dispatch which one you send to

richiardiandrea17:02:44

Ghadi, happy to help with the code base, keep in mind that that same code could already be in cider or spiral in some way or another

ghadi17:02:36

It is in some way or another but honestly both of those projects are approaches that are not as simple as inf-clojure could be

richiardiandrea17:02:48

Inf-clolure was born as simple wrapper over comint which unfortunately is a limitation

ghadi17:02:01

Can you open two comints?

richiardiandrea17:02:02

I know I know, just putting all the cards on the table simple_smile

richiardiandrea17:02:16

Yes you can iirc

ghadi17:02:26

You already do it for multiple inf-clojure sessions no?

richiardiandrea17:02:28

For the "tooling" connection there is a comint redirection

richiardiandrea17:02:33

To a hidden buffer

richiardiandrea17:02:12

But yes iirc multiple REPL buffers use a new comint connection/process call

richiardiandrea17:02:58

The redirection is obviously a hack as well 😃

richiardiandrea17:02:43

I never had this need because probably lumo saves those for me btw...which is interesting as well

richiardiandrea17:02:19

@ghadi I also wanted to past this excerpt here: Socket sessions To allow a tool to share repl context with a user's repl, we want to have two repl client connections that share a "session", essentially the dynamic context in which they evaluate things. This allows an internal tool repl to get access to dynamic variables like \ns or potentially any other dynamic variable binding state. To record binding state: After every eval in the socket repl, get and store the current bindings in the server map To use binding state: Allow a socket client repl to attach to a different session - this is done by recording the attached session id in this session's state Before every eval, if client is attached Get attached session's bindings Replace the stream bindings (in/out/err) with the client repl's bindings (don't want to hijack those) Push the attached session's bindings After every eval, if client is attached Pop the bindings

ghadi21:02:43

I guess I disagree with the premise that tooling and user input need to share anything

ghadi21:02:36

keep inf-clojure inferior

ghadi21:02:43

you can build something nearly as sophisticated as unrepl or cider with a simpler approach

ghadi21:02:00

for some value of nearly

richiardiandrea21:02:51

I am neutral on that, as long as we keep productivity high and we keep things simple I am open to anything...I switched to inf-clojure because of the ease in debugging potential problems with "middleware" (which in inf-clojure are just repl functions)

ghadi21:02:05

two sockets, share nothing == bliss to me

richiardiandrea21:02:41

I think that's what spiral is doing no?

ghadi21:02:56

I look at the experience from the perspective of the core LangServer API -- (code completion, hover, jump to definition, find references). While it would certainly be easy to want to share *ns* across user + machine sockets, it is not necessary to properly support those features/APIs

richiardiandrea21:02:40

it is good, I am not an elisp expert, didn't event know that Emacs could use a socket like that

richiardiandrea21:02:43

comint gives you history search and low-level response facilities though, so I don't know if it can be dropped

ghadi21:02:25

what would be very useful is something like clojure.core.server/remote-prepl but in elisp

richiardiandrea21:02:44

I dreamed about that for long time

richiardiandrea21:02:13

edn.el can transform back and forth and I started doing something in inf-clojure towards that

ghadi21:02:03

you could save your repl sessions on the emacs side, including out/err/ret stream separation

ghadi21:02:15

and choose what to display, without relying on comint's history

richiardiandrea21:02:18

yeah that would be doable as well

ghadi21:02:56

<- comments the peanut gallery 🙂

richiardiandrea21:02:04

that's why at some point I wanted to have a socket server implementation of the Server Language Protocol

richiardiandrea21:02:12

Emacs already understands that

ghadi21:02:17

but we have a repl. I'm just taking LSP as API inspiration for "minimal functionality"

ghadi21:02:18

what is sufficient to do context-specific code completion? active file, cursor position/token

richiardiandrea21:02:17

yeah that is definitely good to read, was thinking of doing the same 😄

ghadi21:02:22

yeah I pretty much guessed right

ghadi21:02:09

there's also completion trigger types too, might not matter

ghadi21:02:38

it's weird because completion (from within a buffer) has nothing to do with any repl's current ns

ghadi21:02:49

it has to do with buffer context

richiardiandrea21:02:28

yep, that's how compliment does it

dpsutton22:02:58

@ghadi what does your workflow look like right now?

ghadi22:02:51

clj, socket server with my own custom repl, inf-clojure

ghadi22:02:00

eval from the buffer into the repl

ghadi22:02:13

i switch between inf-clojure and spiral every few weeks

ghadi22:02:51

i generally don't use autocompletion, but I'm sure it would be nice if it worked consistently for me

dpsutton22:02:27

I'd love to see a screen cast of you and David nolen to watch how y'all work

ghadi22:02:53

lots of swearing

dpsutton22:02:54

I love the idea of Bruce's rebel readline but I'm always in my editor

richiardiandrea23:02:00

Same here, however if emacs had a fully fledged terminal one could use both at the same time, it might actually work (has to be the same socket server session though)

qqq23:02:44

without pre instrumenting every function, in cider, is there a way, after getting an exception, to click on a line in the stack frame corresponding to a *.clj line, and get it to show all the locals ?