Fork me on GitHub
#unrepl
<
2017-04-05
>
thheller00:04:37

REPL really is such a misused concept in the clojure world

thheller00:04:48

and tools.nrepl is totally mislabeled, it should be tools.remote or so šŸ˜‰

thheller01:04:49

@cgrand just noticed that fipp is doing something similar to the custom formatters https://github.com/brandonbloom/fipp/blob/master/doc/primitives.md

cgrand07:04:23

@thheller I drew inspiration from fipp but this part of it (or custom formatters) is too much layout focused (hey itā€™s a pretty printer) while Iā€™m concerned about ā€œmachineā€ printing. Layout is a concern for the client.

thheller07:04:10

yeah its too focused on clojure as well

thheller07:04:55

but I was looking for prior art for describing objects and it seems fairly common to create some kind of limited markup

thheller07:04:36

but as you said its not about pretty printing

cgrand08:04:49

@dominicm all tooling is not repl indeed. However it doesnā€™t imply that you canā€™t devise an adhoc protocol by subsetting unrepl

dominicm10:04:54

@cgrand you made that comment before, it only now makes sense. It might be interesting to see if a shared protocol can come out of subsets.

cgrand11:04:33

@dominicm itā€™s the old age that makes me to ramble

dominicm11:04:34

It's good, for me. Helps me learn. Hopefully it doesn't waste too much of your time with my bombardment of questions!

pesterhazy11:04:21

IMO many of these questions are not at all clear yet, so any discussion is useful.

cgrand12:04:19

(this is the output of (repeat (range)))

cgrand12:04:55

(or rather the rendering of the represetation of the value of (repeat (range)))

thheller13:04:18

rendered where? as html? can you click the ...?

cgrand13:04:00

as html in an electron unrepl client (it has been years since Iā€™ve done frontend)

cgrand13:04:25

not yet clickable (I havenā€™t set up the second socket)

cgrand13:04:20

Iā€™m cheating on the rendering:

ol, ul, dl {display: inline-block; margin: 0; padding: 0;}
li, dt, dd {display: inline; margin 0; padding: 0;}
dd + dt::before {content:", "}
li + li::before {content:" "}

.list::before {content: "("}
.list::after {content: ")"}
.vector::before {content: "["}
.vector::after {content: "]"}
.set::before {content: "#{"}
.set::after {content: "}"}

cgrand13:04:51

the browser takes care of the parens, spacing and commas

pesterhazy14:04:07

I'm still figuring out a nice terminal UI for elisions

pesterhazy14:04:39

it could print elisions as #unrepl/... 1, #unrepl/... 2 etc

pesterhazy14:04:58

then a special command like expand 1 could be used to expand successively

pesterhazy14:04:31

$ try --debug
Unravel 0.1.4 connected to localhost:50505

Type ^O for docs of symbol under cursor, ^D to quit
[:receive [:unrepl/hello {:session :session559, :actions {:exit (unrepl.repl/exit! :session559)}}]]
[:receive [:prompt {}]]
>

pesterhazy14:04:56

@cgrand, :prompt doesn't pass the current *ns* anymore. Is that an oversight?

pesterhazy14:04:11

If so I'll do a PR

cgrand14:04:53

@pesterhazy I added it back one or two days ago

cgrand14:04:52

@pesterhazy #unrepl/... 1, #unrepl/... 2 are a bit long for display to the user. &1, &2 ?

pesterhazy15:04:59

I can use a different color too

richiardiandrea16:04:11

Is unravel already exposing a completion function, a source function, a doc function (for the last two, I guess I can just evaluate forms directly maybe?). I am thinking of adding it to inf-clojure

pesterhazy16:04:06

hmm... I think it may make more sense to use the unrepl code directly from emacs

pesterhazy16:04:39

unravel is intended to be used interactively, mostly

richiardiandrea16:04:50

well, I have already added the concept of repl types in inf-clojure, and lumo and planck now are supported

pesterhazy16:04:09

so I think doc and complete should be added to unrepl proper

pesterhazy16:04:17

eventually I mean

pesterhazy16:04:49

lumo and planck have dumb modes (`-d`) so I'll have to add that to unravel

richiardiandrea16:04:21

yeah I think the same, actually let me link what inf-clojure does now

richiardiandrea16:04:27

yep that is useful

richiardiandrea16:04:52

we just send a string for evaluation to the process

richiardiandrea16:04:03

different for any repl

pesterhazy16:04:43

well eventually I think that code should be added to unrepl

richiardiandrea16:04:05

the supported commands that you can do from emacs are a bit above: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L103

pesterhazy16:04:05

so we have a single codebase that handles tooling functionality

richiardiandrea16:04:28

they are the classic doc, source, macroexpand....

pesterhazy16:04:49

that's useful

richiardiandrea16:04:03

I like this new trend of minimal setup

richiardiandrea16:04:33

I wish I could contribute more but now I am super busy, hopefully soon things will improve on my side

pesterhazy16:04:56

lots of things are still in flux with unrepl, but tons of opportunities at the moment

pesterhazy16:04:14

I think it's important to get a lot of input from tooling authors to get things right this time

pesterhazy16:04:30

(after learning from experiences with nREPL)

pesterhazy16:04:03

it could really be a big plus for clojure compared to other languages

pesterhazy16:04:13

to have a good tooling story

richiardiandrea16:04:12

the above ellipsis on long output is wonderful btw

pesterhazy16:04:35

my idea with unravel is to showcase the capabilities that unrepl unlocks, to get other tooling authors on board šŸ™‚

richiardiandrea16:04:45

that's awesome, keep it up and you'll be rewarded šŸ˜„

pesterhazy16:04:58

yeah feel free to use that if it helps

pesterhazy16:04:06

it's triggered by tab

richiardiandrea16:04:32

yes that's perfect, also very nice that you have an explicit cmd-doc, I can just call that passing the symbol that I get from emacs

richiardiandrea16:04:12

and probably the send! function can actually be used for everything else

pesterhazy16:04:33

that's on the cljs side btw, so you can't call it by just sending text to stdin

richiardiandrea16:04:59

uhm, you are right

richiardiandrea17:04:54

I could basically send you control codes to the process as well, maybe that can be a good workaround if the repl does not expose "system" namespace

pesterhazy16:04:04

now I'm thinking it'd be great to have the arglist printed out automatically as you're typing a symbol...

richiardiandrea16:04:44

yeah I added get-arglists in lumo for that

pesterhazy22:04:50

New release 0.1.6 adds expansion of lazy seqs!

richiardiandrea23:04:02

ā˜ļø cool stuff!