unrepl

discussing specification of an edn-based repl and its implementations.
thheller 2017-04-05T00:02:37.355813Z

REPL really is such a misused concept in the clojure world

thheller 2017-04-05T00:03:48.368379Z

and tools.nrepl is totally mislabeled, it should be tools.remote or so 😉

thheller 2017-04-05T01:57:49.337287Z

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

cgrand 2017-04-05T07:51:23.132912Z

@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.

thheller 2017-04-05T07:56:10.193980Z

yeah its too focused on clojure as well

thheller 2017-04-05T07:56:55.204041Z

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

thheller 2017-04-05T07:57:36.212899Z

but as you said its not about pretty printing

cgrand 2017-04-05T08:00:49.258588Z

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

dominicm 2017-04-05T10:56:54.753641Z

@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.

cgrand 2017-04-05T11:02:33.828688Z

@dominicm it’s the old age that makes me to ramble

🙂 1
dominicm 2017-04-05T11:10:34.926896Z

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

pesterhazy 2017-04-05T11:11:44.940548Z

not at all

pesterhazy 2017-04-05T11:12:21.948115Z

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

cgrand 2017-04-05T12:58:19.417148Z

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

cgrand 2017-04-05T12:59:55.445943Z

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

thheller 2017-04-05T13:00:18.455389Z

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

cgrand 2017-04-05T13:01:00.470018Z

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

cgrand 2017-04-05T13:02:25.498663Z

not yet clickable (I haven’t set up the second socket)

cgrand 2017-04-05T13:03:20.516538Z

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: "}"}

😍 1
cgrand 2017-04-05T13:03:51.526103Z

the browser takes care of the parens, spacing and commas

thheller 2017-04-05T13:29:56.035014Z

neato

pesterhazy 2017-04-05T14:23:45.283725Z

nice!

pesterhazy 2017-04-05T14:24:07.292972Z

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

pesterhazy 2017-04-05T14:26:39.356549Z

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

pesterhazy 2017-04-05T14:27:58.389449Z

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

pesterhazy 2017-04-05T14:32:31.504584Z

$ 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 {}]]
>

pesterhazy 2017-04-05T14:32:56.514983Z

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

pesterhazy 2017-04-05T14:33:11.520817Z

If so I'll do a PR

cgrand 2017-04-05T14:56:53.125078Z

@pesterhazy I added it back one or two days ago

thheller 2017-04-05T14:56:57.126975Z

sweet

cgrand 2017-04-05T14:59:52.204142Z

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

pesterhazy 2017-04-05T15:00:46.231776Z

Good idea

pesterhazy 2017-04-05T15:00:59.237775Z

I can use a different color too

richiardiandrea 2017-04-05T16:41:11.712164Z

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

pesterhazy 2017-04-05T16:43:06.754238Z

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

👍 1
pesterhazy 2017-04-05T16:43:39.766086Z

unravel is intended to be used interactively, mostly

richiardiandrea 2017-04-05T16:43:50.770036Z

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

pesterhazy 2017-04-05T16:44:09.776697Z

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

pesterhazy 2017-04-05T16:44:17.779434Z

eventually I mean

pesterhazy 2017-04-05T16:44:49.791353Z

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

richiardiandrea 2017-04-05T16:45:21.802917Z

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

richiardiandrea 2017-04-05T16:45:27.805227Z

yep that is useful

richiardiandrea 2017-04-05T16:45:35.807939Z

so here for instance https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L255

richiardiandrea 2017-04-05T16:45:52.814465Z

we just send a string for evaluation to the process

richiardiandrea 2017-04-05T16:46:03.818186Z

different for any repl

pesterhazy 2017-04-05T16:46:33.829458Z

I see

pesterhazy 2017-04-05T16:46:43.833214Z

well eventually I think that code should be added to unrepl

richiardiandrea 2017-04-05T16:47:05.841150Z

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

pesterhazy 2017-04-05T16:47:05.841509Z

so we have a single codebase that handles tooling functionality

richiardiandrea 2017-04-05T16:47:28.850087Z

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

pesterhazy 2017-04-05T16:47:49.857461Z

that's useful

richiardiandrea 2017-04-05T16:48:03.862636Z

I like this new trend of minimal setup

richiardiandrea 2017-04-05T16:48:33.873952Z

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

pesterhazy 2017-04-05T16:48:56.882280Z

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

pesterhazy 2017-04-05T16:49:14.888808Z

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

pesterhazy 2017-04-05T16:49:30.895160Z

(after learning from experiences with nREPL)

pesterhazy 2017-04-05T16:50:03.906819Z

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

pesterhazy 2017-04-05T16:50:13.910712Z

to have a good tooling story

richiardiandrea 2017-04-05T16:50:32.917778Z

yeah I agree

richiardiandrea 2017-04-05T16:51:12.932152Z

the above ellipsis on long output is wonderful btw

pesterhazy 2017-04-05T16:51:35.941066Z

my idea with unravel is to showcase the capabilities that unrepl unlocks, to get other tooling authors on board 🙂

richiardiandrea 2017-04-05T16:52:45.966629Z

that's awesome, keep it up and you'll be rewarded 😄

richiardiandrea 2017-04-05T16:54:07.996161Z

you are already exposing a complete function actually (https://github.com/pesterhazy/unravel/blob/master/src/unravel/core.cljs#L202)

pesterhazy 2017-04-05T16:54:58.015018Z

yeah feel free to use that if it helps

pesterhazy 2017-04-05T16:55:06.018081Z

it's triggered by tab

richiardiandrea 2017-04-05T16:56:32.051070Z

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

richiardiandrea 2017-04-05T16:57:12.065654Z

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

pesterhazy 2017-04-05T16:57:33.073978Z

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

pesterhazy 2017-04-05T16:58:04.085758Z

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

richiardiandrea 2017-04-05T16:58:44.101052Z

yeah I added get-arglists in lumo for that

richiardiandrea 2017-04-05T16:59:59.129503Z

uhm, you are right

richiardiandrea 2017-04-05T17:13:54.444511Z

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

pesterhazy 2017-04-05T22:09:50.599270Z

New release 0.1.6 adds expansion of lazy seqs!

richiardiandrea 2017-04-05T23:37:02.639536Z

☝️ cool stuff!