unrepl

discussing specification of an edn-based repl and its implementations.
cgrand 2017-12-11T09:38:19.000302Z

Good morning guys!

dominicm 2017-12-11T09:40:15.000454Z

Morning!

pesterhazy 2017-12-11T09:40:46.000213Z

morning

cgrand 2017-12-11T09:42:22.000085Z

Who was at ClojureX?

pesterhazy 2017-12-11T09:46:25.000174Z

Not me. How was lambda up?

cgrand 2017-12-11T09:46:48.000180Z

lambdup

cgrand 2017-12-11T09:48:37.000476Z

It was cool, I found the crowd a bit shy. However for a first event set up in less than 3 months it was great.

pesterhazy 2017-12-11T09:51:17.000335Z

Did you deliver a talk?

cgrand 2017-12-11T09:53:04.000180Z

yes on value-programming

dominicm 2017-12-11T09:54:50.000069Z

I know people who were at ClojureX, but had to give it a pass myself due to a delivery deadline. Why do you ask @cgrand?

pesterhazy 2017-12-11T09:55:04.000128Z

La Valeur des Valeurs?

cgrand 2017-12-11T09:55:14.000103Z

C’est ça

cgrand 2017-12-11T09:56:06.000504Z

@dominicm to know about hallway buzz, if there was some toolings talk etc.

dominicm 2017-12-11T09:58:36.000329Z

@cgrand @bozhidar gave a talk, so I suspect there will be. I'll see if I can get some information from my colleagues.

cgrand 2017-12-11T10:59:31.000152Z

about jack-in: it’s funny that we never discussed using stdin/stdout for jackin

pesterhazy 2017-12-11T11:00:46.000030Z

using a network socket was simpler for now (no multiplexing, no worrying about rogue printlns etc.)

pesterhazy 2017-12-11T11:05:16.000340Z

btw I figured out how to distinguish Return (`^M`, \r) from Enter (`^J`, \n)

cgrand 2017-12-11T11:05:34.000087Z

I agree but it was not even mentioned

cgrand 2017-12-11T11:05:36.000369Z

how?

pesterhazy 2017-12-11T11:06:18.000398Z

node's readline creates two events - the line event (`\n` in each time)

pesterhazy 2017-12-11T11:07:02.000328Z

but there's also the keypress event, which has :name "return" and :name "enter" respectively

pesterhazy 2017-12-11T11:08:06.000132Z

in my pau/newline branch, there's a new command scripts/debug which gives you a nice two-pane debugging view

pesterhazy 2017-12-11T11:08:30.000001Z

with mouse support 🙂

dominicm 2017-12-11T11:09:44.000150Z

That's very cool

volrath 2017-12-11T11:13:47.000079Z

cool!

cgrand 2017-12-11T11:44:28.000357Z

naive question: from the process point of view there’s no way to tell between ^J/^M and actual entre/return keys?

pesterhazy 2017-12-11T11:46:52.000394Z

I think the terminal emulator sends ^M when you press enter

pesterhazy 2017-12-11T11:49:40.000001Z

https://github.com/Unrepl/unravel/pull/51 now works as expected in interactive mode, but now it doesn't work in non-interactive mode anymore 🙂

pesterhazy 2017-12-11T11:56:36.000163Z

Damn it! Github insists on showing a wrong diff for the PR

pesterhazy 2017-12-11T12:09:43.000172Z

Finally a clean diff: https://github.com/Unrepl/unravel/pull/61/files

cgrand 2017-12-11T12:14:43.000092Z

works fine for me (modulo our disagreement on behavior for 1-line well formed forms)

pesterhazy 2017-12-11T12:41:46.000403Z

@cgrand any idea on how to support noninteractive input cleanly?

cgrand 2017-12-11T12:44:30.000303Z

you mean short of the global flag?

pesterhazy 2017-12-11T13:01:19.000185Z

@cgrand no, I mean that non-interactive use on my branch is broken:

$ echo '(+ 1 1)' | run
(+ 1 1)

(+ 1 1)

pesterhazy 2017-12-11T13:01:40.000151Z

using the global flag is fine

cgrand 2017-12-11T13:02:08.000086Z

Let me try

cgrand 2017-12-11T13:02:46.000351Z

in the meantime, I wanted to play with completion but readline hinders me

pesterhazy 2017-12-11T13:04:46.000063Z

how do you mean?

pesterhazy 2017-12-11T13:11:00.000282Z

ok pushed a fix

cgrand 2017-12-11T13:15:26.000140Z

The crux of the issue is that line is not used anymore and a final line is sent when the input terminates.

cgrand 2017-12-11T13:16:11.000453Z

I do think that line is a good thing to keep (even if the name is a bit inexact now)

cgrand 2017-12-11T13:16:34.000014Z

We are competing with https://github.com/nodejs/node/blob/master/lib/readline.js#L920-L932

cgrand 2017-12-11T13:17:33.000165Z

Am I the only one who finds crlf detection based on timeout weird?

cgrand 2017-12-11T13:18:18.000138Z

ok they reset _sawReturnAt to 0 for every other key

cgrand 2017-12-11T13:20:16.000213Z

again we are fighting readline

pesterhazy 2017-12-11T13:23:41.000049Z

very weird!

pesterhazy 2017-12-11T13:24:30.000204Z

they must have a reason for that though

pesterhazy 2017-12-11T13:24:38.000509Z

terminals are full of cruft

cgrand 2017-12-11T13:24:42.000509Z

certainly

pesterhazy 2017-12-11T13:25:12.000076Z

ok the pushed version works for me now in interactive and non-interactive modes

pesterhazy 2017-12-11T13:25:25.000091Z

$ echo '(str "it " "works")' | run

"it works"

pesterhazy 2017-12-11T13:25:49.000106Z

that seems like a spurious newline but can't find where it comes from

pesterhazy 2017-12-11T13:26:32.000365Z

hm only with a rich terminal

$ echo '(str "it " "works")' | run | cat
"it works"

cgrand 2017-12-11T13:26:59.000342Z

rationale is meh https://github.com/nodejs/node/pull/8109

cgrand 2017-12-11T13:28:00.000197Z

no term cruftiness just a CRLF captcha: system or user?

pesterhazy 2017-12-11T13:30:08.000152Z

hehe CRLF captcha

pesterhazy 2017-12-11T13:31:15.000435Z

Welp, now it echos back the form sent:

$ echo '(str "it " "works")' | run
(str "it " "works")
"it works"

pesterhazy 2017-12-11T13:36:30.000062Z

are we printing this, or is this readline?

pesterhazy 2017-12-11T13:40:17.000386Z

something to do with the _ttyWrite function: https://github.com/Unrepl/unravel/blob/newline2/src/unravel/loop.cljs#L506

cgrand 2017-12-11T13:58:53.000632Z

it has always iechoed no?

cgrand 2017-12-11T13:59:06.000070Z

it’s part of readline, no?

cgrand 2017-12-11T13:59:44.000265Z

when readline gets a char it prints it (and put it into the line buffer)

cgrand 2017-12-11T14:06:51.000622Z

frustrations on readline: keypress vs ttywrite, rendering model

cgrand 2017-12-11T14:07:37.000613Z

everything in internal/readline.js seems useful

pesterhazy 2017-12-11T15:03:14.000186Z

I agree 100% but rewriting readline-ish functionality is gnarly as hell

cgrand 2017-12-11T15:12:18.000524Z

since @volrath question about eval-file I have been pondering if there is a need for such operation vs streaming it over the user a connection

cgrand 2017-12-11T15:30:14.000404Z

To me the main difference, at first, is that when you load a file, evaluation stops at first error, while if you cat the file it will keep evaluating. But that’s no big deal in practice. A more important difference is that there’s no EOF so a malformed exception would just hangs the connection — and closing the connection would make impossible to get messages back from eval, except if we add a way to have an half-closed connection.

volrath 2017-12-11T15:31:21.000557Z

did you check the implementation?

cgrand 2017-12-11T15:31:36.000511Z

A minor difference is that *in* is set set differently (it would be fun to have *in* set to the file being compiled as it would allow to “upgrade” a file in the same way we upgrade a connection: “after the blob it’s some BASIC”)

volrath 2017-12-11T15:32:05.000355Z

at the beginning I was pondering just streaming the content through the conn

cgrand 2017-12-11T15:32:05.000427Z

@volrath no, did I miss an important detail?

volrath 2017-12-11T15:32:44.000844Z

but with Compiler/load, the exception comes with filename/filepath and lineno

bozhidar 2017-12-11T15:33:06.000181Z

I think when it comes to ClojureX and tooling people wanted better dev tools for ClojureScript. 🙂

cgrand 2017-12-11T15:33:50.000381Z

CLJS/JVM or CLJS/JS?

bozhidar 2017-12-11T15:33:58.000356Z

I did give a talk, but it wasn’t anything special - just a bit of CIDER and clojure-emacs updates, a note about nREPL’s rebooted development and some ideas about the future of CIDER and nREPL.

2017-12-12T13:04:07.000174Z

Don’t sell yourself short… your talk was ace! 🙂

bozhidar 2017-12-11T15:34:05.000735Z

CLJS/JS

bozhidar 2017-12-11T15:34:15.000025Z

There was a good Lumo talk that generated some buzz.

cgrand 2017-12-11T15:34:16.000444Z

really?

cgrand 2017-12-11T15:34:34.000127Z

true Antonio was there

bozhidar 2017-12-11T15:34:41.000879Z

Indeed, he gave the talk.

bozhidar 2017-12-11T15:34:43.000896Z

🙂

volrath 2017-12-11T15:34:47.000466Z

I also pondered to make it a "stand alone" session action.. but I thought for the purpose of getting my first custom tooling module, I'd start with that and if there were have to be any special treatment for big files (like nrepl), it'd be easy to put in

bozhidar 2017-12-11T15:35:32.000245Z

But I think people would be pretty happy with some better when it comes to CLJS/JVM as well.