Good morning guys!
Morning!
morning
Who was at ClojureX?
Not me. How was lambda up?
lambdup
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.
Did you deliver a talk?
yes on value-programming
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?
La Valeur des Valeurs?
C’est ça
@dominicm to know about hallway buzz, if there was some toolings talk etc.
about jack-in: it’s funny that we never discussed using stdin/stdout for jackin
using a network socket was simpler for now (no multiplexing, no worrying about rogue printlns etc.)
btw I figured out how to distinguish Return (`^M`, \r
) from Enter (`^J`, \n
)
I agree but it was not even mentioned
how?
node's readline creates two events - the line
event (`\n` in each time)
but there's also the keypress event, which has :name "return"
and :name "enter"
respectively
in my pau/newline
branch, there's a new command scripts/debug
which gives you a nice two-pane debugging view
with mouse support 🙂
That's very cool
cool!
naive question: from the process point of view there’s no way to tell between ^J/^M and actual entre/return keys?
I think the terminal emulator sends ^M
when you press enter
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 🙂
Damn it! Github insists on showing a wrong diff for the PR
Finally a clean diff: https://github.com/Unrepl/unravel/pull/61/files
works fine for me (modulo our disagreement on behavior for 1-line well formed forms)
@cgrand any idea on how to support noninteractive input cleanly?
you mean short of the global flag?
@cgrand no, I mean that non-interactive use on my branch is broken:
$ echo '(+ 1 1)' | run
(+ 1 1)
(+ 1 1)
using the global flag is fine
Let me try
in the meantime, I wanted to play with completion but readline hinders me
how do you mean?
ok pushed a fix
The crux of the issue is that line
is not used anymore and a final line
is sent when the input terminates.
I do think that line
is a good thing to keep (even if the name is a bit inexact now)
We are competing with https://github.com/nodejs/node/blob/master/lib/readline.js#L920-L932
Am I the only one who finds crlf detection based on timeout weird?
ok they reset _sawReturnAt
to 0 for every other key
again we are fighting readline
very weird!
they must have a reason for that though
terminals are full of cruft
certainly
ok the pushed version works for me now in interactive and non-interactive modes
$ echo '(str "it " "works")' | run
"it works"
that seems like a spurious newline but can't find where it comes from
hm only with a rich terminal
$ echo '(str "it " "works")' | run | cat
"it works"
rationale is meh https://github.com/nodejs/node/pull/8109
no term cruftiness just a CRLF captcha: system or user?
hehe CRLF captcha
Welp, now it echos back the form sent:
$ echo '(str "it " "works")' | run
(str "it " "works")
"it works"
are we printing this, or is this readline?
something to do with the _ttyWrite function: https://github.com/Unrepl/unravel/blob/newline2/src/unravel/loop.cljs#L506
it has always iechoed no?
it’s part of readline, no?
when readline gets a char it prints it (and put it into the line buffer)
frustrations on readline: keypress vs ttywrite, rendering model
everything in internal/readline.js
seems useful
I agree 100% but rewriting readline-ish functionality is gnarly as hell
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
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.
did you check the implementation?
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”)
at the beginning I was pondering just streaming the content through the conn
@volrath no, did I miss an important detail?
but with Compiler/load, the exception comes with filename/filepath and lineno
I think when it comes to ClojureX and tooling people wanted better dev tools for ClojureScript. 🙂
CLJS/JVM or CLJS/JS?
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.
Don’t sell yourself short… your talk was ace! 🙂
CLJS/JS
There was a good Lumo talk that generated some buzz.
really?
true Antonio was there
Indeed, he gave the talk.
🙂
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
But I think people would be pretty happy with some better when it comes to CLJS/JVM as well.