Fork me on GitHub
#unrepl
<
2017-12-11
>
cgrand09:12:19

Good morning guys!

cgrand09:12:22

Who was at ClojureX?

pesterhazy09:12:25

Not me. How was lambda up?

cgrand09:12:37

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.

pesterhazy09:12:17

Did you deliver a talk?

cgrand09:12:04

yes on value-programming

dominicm09:12:50

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?

pesterhazy09:12:04

La Valeur des Valeurs?

cgrand09:12:14

C’est ça

cgrand09:12:06

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

dominicm09:12:36

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

cgrand10:12:31

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

pesterhazy11:12:46

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

pesterhazy11:12:16

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

cgrand11:12:34

I agree but it was not even mentioned

pesterhazy11:12:18

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

pesterhazy11:12:02

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

pesterhazy11:12:06

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

pesterhazy11:12:30

with mouse support 🙂

dominicm11:12:44

That's very cool

cgrand11:12:28

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

pesterhazy11:12:52

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

pesterhazy11:12:40

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 🙂

pesterhazy11:12:36

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

cgrand12:12:43

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

pesterhazy12:12:46

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

cgrand12:12:30

you mean short of the global flag?

pesterhazy13:12:19

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

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

(+ 1 1)

pesterhazy13:12:40

using the global flag is fine

cgrand13:12:08

Let me try

cgrand13:12:46

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

pesterhazy13:12:46

how do you mean?

pesterhazy13:12:00

ok pushed a fix

cgrand13:12:26

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

cgrand13:12:11

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

cgrand13:12:33

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

cgrand13:12:18

ok they reset _sawReturnAt to 0 for every other key

cgrand13:12:16

again we are fighting readline

pesterhazy13:12:30

they must have a reason for that though

pesterhazy13:12:38

terminals are full of cruft

pesterhazy13:12:12

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

pesterhazy13:12:25

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

"it works"

pesterhazy13:12:49

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

pesterhazy13:12:32

hm only with a rich terminal

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

cgrand13:12:00

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

pesterhazy13:12:08

hehe CRLF captcha

pesterhazy13:12:15

Welp, now it echos back the form sent:

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

pesterhazy13:12:30

are we printing this, or is this readline?

cgrand13:12:53

it has always iechoed no?

cgrand13:12:06

it’s part of readline, no?

cgrand13:12:44

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

cgrand14:12:51

frustrations on readline: keypress vs ttywrite, rendering model

cgrand14:12:37

everything in internal/readline.js seems useful

pesterhazy15:12:14

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

cgrand15:12:18

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

cgrand15:12:14

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.

volrath15:12:21

did you check the implementation?

cgrand15:12:36

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”)

volrath15:12:05

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

cgrand15:12:05

@volrath no, did I miss an important detail?

volrath15:12:44

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

bozhidar15:12:06

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

cgrand15:12:50

CLJS/JVM or CLJS/JS?

bozhidar15:12:58

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.

rickmoynihan13:12:07

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

bozhidar15:12:15

There was a good Lumo talk that generated some buzz.

cgrand15:12:34

true Antonio was there

bozhidar15:12:41

Indeed, he gave the talk.

volrath15:12:47

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

bozhidar15:12:32

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