Fork me on GitHub
#unrepl
<
2017-04-02
>
pesterhazy12:04:53

Installing unravel is now as easy as

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

thheller16:04:27

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

thheller16:04:54

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

thheller16:04:33

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

thheller16:04:32

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

thheller16:04:46

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

thheller16:04:21

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

thheller16:04:25

that enables this

thheller16:04:57

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

thheller16:04:32

not everything I do is a REPL print after all

pesterhazy16:04:14

Released version 0.1.3 with persistent readline history

pesterhazy16:04:31

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

pesterhazy16:04:50

there are two challenges there

thheller16:04:54

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

pesterhazy16:04:00

1. the elision system

pesterhazy16:04:04

2. presentation

pesterhazy16:04:28

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

thheller16:04:03

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

pesterhazy16:04:04

allowing you to request more data (continuation)

thheller16:04:06

not a REPL thing

pesterhazy16:04:20

how do you mean?

pesterhazy16:04:42

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

pesterhazy16:04:00

you can do a lot (ascii tables etc.)

thheller16:04:03

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

thheller16:04:16

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

pesterhazy16:04:18

but a browser in undoubtedly better suited for interactive printing

thheller16:04:39

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

pesterhazy16:04:17

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

thheller16:04:39

(log/warn "Got request" request) 😉

thheller16:04:51

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

thheller16:04:02

but does the default in production

pesterhazy16:04:26

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

thheller16:04:10

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

thheller16:04:19

print that once and the REPL is toast

pesterhazy16:04:56

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

thheller16:04:02

yet sometimes that is exactly want I want to do

pesterhazy16:04:16

printing that on every swap! is very useful for debugging

pesterhazy16:04:25

but it gets unwieldy quickly

pesterhazy16:04:44

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

pesterhazy16:04:59

a general solution to that would be handy

thheller17:04:29

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

thheller17:04:44

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

thheller17:04:01

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

pesterhazy17:04:05

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

pesterhazy17:04:41

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

thheller17:04:56

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

thheller17:04:24

just need to device a proper network protocol for that

thheller17:04:47

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

thheller17:04:28

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

thheller17:04:39

with a dedicated connection

cgrand18:04:46

Logging! What an oversight!

cgrand18:04:02

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

dominicm21:04:33

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

dominicm21:04:51

Object probably wrong term. Op?

cgrand21:04:38

No objX is the unrepl representation of à logged object.