unrepl

discussing specification of an edn-based repl and its implementations.
pesterhazy 2017-04-02T12:22:53.149833Z

Installing unravel is now as easy as

sudo npm install -g lumo-cljs unravel-repl
and
unravel localhost 50505

👍 1
thheller 2017-04-02T16:38:27.008564Z

hey, I've been occupied with a bunch of other stuff lately

thheller 2017-04-02T16:38:54.010171Z

that involved doing a bunch of CLJ and little CLJS, what I really miss the most is this kind of stuff

thheller 2017-04-02T16:40:33.016705Z

no idea how that would work in a terminal but I got so used to having this it really felt bad working without it

thheller 2017-04-02T16:46:32.039147Z

so the elision system has me the most excited at the moment, normal print is so terrible in comparison 😛

thheller 2017-04-02T16:47:46.043681Z

I wonder though if that might not be better as a general sort of thing

thheller 2017-04-02T16:48:21.045865Z

ie. you use tools.logging as normal but attach a special custom appender in development

thheller 2017-04-02T16:48:25.046118Z

that enables this

thheller 2017-04-02T16:48:57.047965Z

same thing really in JS, it's just console.log but with a few custom hooks in dev

thheller 2017-04-02T16:49:32.050162Z

not everything I do is a REPL print after all

pesterhazy 2017-04-02T16:50:14.052983Z

Released version 0.1.3 with persistent readline history

pesterhazy 2017-04-02T16:52:31.061535Z

@thheller you mean the ability to collapse/expand nested data structures interactively?

thheller 2017-04-02T16:52:36.061807Z

yes

pesterhazy 2017-04-02T16:52:50.062687Z

there are two challenges there

thheller 2017-04-02T16:52:54.062938Z

and have them formatted in a structured manner, pprint doesn't cut it

pesterhazy 2017-04-02T16:53:00.063311Z

1. the elision system

pesterhazy 2017-04-02T16:53:04.063594Z

2. presentation

pesterhazy 2017-04-02T16:53:28.065156Z

for 1, what is already there is pretty good. We need to restrict print-length and print-depth

thheller 2017-04-02T16:54:03.067398Z

yeah, just saying that what we have might be better as a general thing

pesterhazy 2017-04-02T16:54:04.067474Z

allowing you to request more data (continuation)

thheller 2017-04-02T16:54:06.067526Z

not a REPL thing

pesterhazy 2017-04-02T16:54:20.068437Z

how do you mean?

pesterhazy 2017-04-02T16:54:42.069705Z

for 2, I agree that squeezing this interactivity into an xterm is not ideal

pesterhazy 2017-04-02T16:55:00.070799Z

you can do a lot (ascii tables etc.)

thheller 2017-04-02T16:55:03.071068Z

as I said above, something like tools.logging. the issue I have with elision only on REPL print

thheller 2017-04-02T16:55:16.071924Z

is that it doesn't cover any kind of debug statement I put in my code

pesterhazy 2017-04-02T16:55:18.072101Z

but a browser in undoubtedly better suited for interactive printing

thheller 2017-04-02T16:55:39.073362Z

so (prn wtf-value) will use the normal print

pesterhazy 2017-04-02T16:56:17.075683Z

basically you want to use (log/warn "Got request" (eliding-pr-str request)) ?

thheller 2017-04-02T16:56:39.077183Z

(log/warn "Got request" request) 😉

thheller 2017-04-02T16:56:51.077951Z

with a custom handler in dev mode that handles the elide part

thheller 2017-04-02T16:57:02.078607Z

but does the default in production

pesterhazy 2017-04-02T16:57:26.079964Z

btw I've encountered the logging problem in the past as well

thheller 2017-04-02T16:58:10.082750Z

its everything I encounter I feel, messed with a bunch of shadow-build the past few days and that has to work with the entire CLJS env

thheller 2017-04-02T16:58:19.083356Z

print that once and the REPL is toast

pesterhazy 2017-04-02T16:58:56.085652Z

I worked on a react-native project where the entire app state was in an atom

thheller 2017-04-02T16:59:02.086126Z

yet sometimes that is exactly want I want to do

pesterhazy 2017-04-02T16:59:16.086889Z

printing that on every swap! is very useful for debugging

pesterhazy 2017-04-02T16:59:25.087463Z

but it gets unwieldy quickly

pesterhazy 2017-04-02T16:59:44.088569Z

so I built a half-baked eliding-prn that just cut off after n keys

pesterhazy 2017-04-02T16:59:59.089547Z

a general solution to that would be handy

thheller 2017-04-02T17:00:29.092767Z

yeah exactly. it really feels terrible in CLJ when you are used to CLJS and the console

thheller 2017-04-02T17:00:44.093865Z

granted that is a browser which has way more capabilities in presentation

thheller 2017-04-02T17:01:01.095360Z

but its still in the browser, if we could move that to something like cursive that would be killer

pesterhazy 2017-04-02T17:01:05.095749Z

well I did have the idea of hooking up unravel to the browser

pesterhazy 2017-04-02T17:01:41.098700Z

basically start a tiny web server and launch a chrome web browser on localhost:12345

thheller 2017-04-02T17:01:56.099973Z

yeah exactly, something that gets it out of the terminal and into a real GUI

thheller 2017-04-02T17:02:24.102328Z

just need to device a proper network protocol for that

thheller 2017-04-02T17:02:47.104172Z

unrepl is a start but I feel not generic enough since its only for repl-print

thheller 2017-04-02T17:05:28.115173Z

but if designed properly this could just be a (hook-into-log) which then upgrades the REPL

thheller 2017-04-02T17:05:39.115828Z

with a dedicated connection

cgrand 2017-04-02T18:31:46.453127Z

Logging! What an oversight!

cgrand 2017-04-02T18:44:02.501077Z

[:log [:level obj1 … objN] id?] ?

dominicm 2017-04-02T21:09:33.069483Z

A special object for logging?! That would be cool.

dominicm 2017-04-02T21:09:51.070810Z

Object probably wrong term. Op?

cgrand 2017-04-02T21:22:38.123675Z

No objX is the unrepl representation of à logged object.