Fork me on GitHub
#dev-tooling
<
2023-06-23
>
bozhidar09:06:36

@mauricio.szabo It's not part of the protocol per-se, so it's hard to query about it. Right now you can check for ops, but not for their supported params.

bozhidar09:06:22

That being said - CIDER supports it, hopefully Calva as well. //cc @pez You can easily check if an editor supports it by checking the message exchange between the editor and nREPL.

pez09:06:28

How does it work? Calva doesn’t support it, but I’d be happy to make it.

mauricio.szabo14:06:40

@pez it's quite simple, you just pass :nrepl.middleware.print/stream? 1 for the nREPL eval op and then "big" results will be returned in batches

mauricio.szabo14:06:53

I'm thinking about supporting it on my new version of Chlorine. The "hard" part is that Chlorine interprets the result (and does not capture it as a string); I made a encoder/decoder based on bencode, but for EDN objects, I want to now try and make it compatible with nREPL stream (by being compatible meaning, make it a lazy list of fragments and let nREPL do its magic and batch specific elements)

pez14:06:40

What are some situations when it matters?

mauricio.szabo15:06:59

@pez you mean, when it's actually useful to return the result as batches?

pez15:06:30

Yes, I haven’t exactly missed it in my own use of the repl.

mauricio.szabo17:06:28

Well, when I evaluate something quite big, or infinite lists, for example, that could be useful

mauricio.szabo17:06:36

Probably you haven't missed because you're capturing the result as strings. I am interpreting the result and converting back to EDN, in some cases this generates a big structure (when debugging Lacinia, for example) and it sometimes I can measure the parsing time in seconds (which is not a good experience, because then I have to render that structure :rolling_on_the_floor_laughing:)

mauricio.szabo17:06:01

With the idea I'm having now, I might be able to "partially parse" something that becomes too big

mauricio.szabo19:06:15

(BTW, @pez, everything I'm doing regarding this partial parse, the serialization, etc is completely separated from Chlorine and it's on its own repository if you want to know more about it 🙂 )

pez19:06:54

I’d be happy to have look!

cfleming21:06:26

I’d like to see that too!