Fork me on GitHub
#unrepl
<
2017-12-15
>
pesterhazy09:12:15

@cgrand trying out plain-repl:

WARNING: Use of undeclared Var lumo.repl/load-data-readers! at line 110 plain_repl/lumo.cljs
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:352:12)
    at plain_repl$lumo$accept_$_epl (evalmachine.<anonymous>:653:8)
    at evalmachine.<anonymous>:294:11
    at Socket.<anonymous> (evalmachine.<anonymous>:101:10)
    at emitNone (events.js:110:20)
    at Socket.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1059:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

pesterhazy09:12:33

and in nc: #object[TypeError TypeError: Cannot read property 'call' of undefined]

pesterhazy09:12:03

this is on lumo 1.7.0 - are you on 1.8 beta?

cgrand09:12:21

I’m using lumo master

pesterhazy09:12:41

I'll try 1.8.0 beta

cgrand09:12:44

(as of weeks ago)

pesterhazy09:12:00

pretty cool. I noticed it ends the lumo process when I type ^D but other than that it works

pesterhazy09:12:56

trying to wrap my head around what this does though haha

cgrand10:12:06

haha found a new minimal formulation!

richiardiandrea16:12:08

Saw plain repl nice!

cgrand16:12:20

@richiardiandrea I’ve found a better way.

cgrand16:12:56

Better = simpler api and less impact on lumo

gcast16:12:39

Does unrepl.el currently support sending new deps to a running SOCKET repl?

richiardiandrea16:12:34

@cgrand would love to try that ;)

gcast16:12:18

darn! I was hoping to use the image rendering feature of unrepl.el to generate graphs of datomic query results but my datomic SOCKET repl is bare bones.

gcast16:12:53

lol may have to use unravel to send deps and then unrepl.el to render graphs once deps are available

cgrand16:12:22

@gcast yes, you can even add to the classpath while the repl is running

cgrand16:12:50

But no packed printing

gcast16:12:43

@cgrand yes to my hacky workaround or yes to sending deps to socket repl using unrepl.el

cgrand17:12:16

@gcast no to your hacky workaround, because of classpath isolation deps added in one repl may not be visible on another (once loaded generally they are but in subtle cases it may fail)

cgrand17:12:56

so unrepl.el allows extending the classpath, even while the repl is already running

cgrand17:12:46

@gcast @volrath is unrepl.el owner

cgrand17:12:23

@pesterhazy @volrath, @gcast is the happy unravel user/evangelist I talked about earlier

cgrand17:12:03

@richiardiandrea I pushed a WIP which you may help with (a problem with ns not being set after eval)

richiardiandrea17:12:41

is the branch on lumo?

richiardiandrea17:12:10

cannot find branches in plain-repl

richiardiandrea17:12:20

(also why plain 😄 ?)

richiardiandrea17:12:52

oh got it, no unrepl..

richiardiandrea18:12:31

so yes basically by using that eval you are changing the global *ns*...which is kept in https://github.com/anmonteiro/lumo/blob/master/src/cljs/snapshot/lumo/repl.cljs#L41

richiardiandrea18:12:46

(btw sorry if I say something you know already)

richiardiandrea18:12:12

it seems to me that your "sessions" should have their own current-ns getter

cgrand20:12:02

I was on my phone so giving you details was arduous.

cgrand20:12:32

in eval, before calling cljs/eval, current-ns contains 'cljs.user and both *ns* and ana/*cljs-ns* have been set. When cljs/eval returns the value for key :ns is nil. No matter what I eval (even if it changes the current namespace).

richiardiandrea20:12:42

Uhm ok will look into that

cgrand20:12:41

there are too many evals in cljs.js-> discrepancies

cgrand21:12:10

I pushed the fix.

richiardiandrea21:12:39

yes I was following the dots as well 😉

richiardiandrea21:12:50

oh you were using eval from cljs.js gotcha

richiardiandrea21:12:32

uhm..stiill not working here...

cgrand21:12:05

the accept ns has changed

cgrand21:12:15

(I just edited the README)

richiardiandrea21:12:24

ok let me see if I am doing it right

cgrand21:12:28

lumo -c src/ -n ‘{“port”: 5557, “accept”: “plain-repl.repl.lumo/accept”}’

cgrand21:12:52

$ nc localhost 5557
cljs.user=> (+ 3 4)
7
cljs.user=> (ns foo.bar)
nil
foo.bar=> *ns*
#object[cljs.core.Namespace]
foo.bar=> (ns-name *1)
foo.bar
foo.bar=>

richiardiandrea21:12:46

ok that works, the client side in the README throws:

return caught_SINGLEQUOTE_.call(null,e,rrepl);
                           ^

TypeError: Cannot read property 'call' of null
    at plain_repl$repl$caught (evalmachine.<anonymous>:471:28)
    at plain_repl$repl$pl (evalmachine.<anonymous>:436:15)
    at plain_repl$repl$then_pl (evalmachine.<anonymous>:429:11)
    at plain_repl$repl$lumo$eval (evalmachine.<anonymous>:229:4)
    at plain_repl$repl$epl (evalmachine.<anonymous>:410:26)
    at evalmachine.<anonymous>:241:11
    at evalmachine.<anonymous>:156:11
    at plain_repl.repl.lumo.bytes_stream_reader.cljs$core$IFn$_invoke$arity$2.plain_repl.repl.lumo.t_plain_repl$repl$lumo60.plain_repl$min$AsyncReader$read_chars$arity$2 (evalmachine.<anonymous>:102:10)
    at plain_repl$min$read_chars (evalmachine.<anonymous>:14:10)
    at plain_repl$repl$skip_if_eol (evalmachine.<anonymous>:149:34)

richiardiandrea21:12:09

I also tried (in-ns 'foo.bar) and it hangs...should be because it is a special function

cgrand21:12:57

Oh I haven’t tried exception, looks like I have a bug.

cgrand21:12:16

I may be burying the lead with my repl impl.

cgrand17:12:20

however the new design is ok

richiardiandrea17:12:33

Ok cool let my try that

cgrand17:12:12

Quick explanation: https://github.com/Unrepl/plain-repl/blob/master/src/plain_repl/min.cljs is impl agnostic stuff that should be better added to cljs but in the meantime, why not spawn this file in a standalone dep

cgrand17:12:06

No more *in*as I’ve been struggling to fine an ok way to manage (or arather encourage) exclusive ownership of a global resource

cgrand17:12:03

So when eval retuns a suspension it means the host repl must pause and yield control to the suspension, passing in as an argument.

richiardiandrea17:12:38

Ok cool, so what about ns problem you have?

cgrand17:12:28

In eval I always get nil out for ns

cgrand17:12:17

There are minor ns conveyance issues but the crux is that one.

richiardiandrea17:12:17

Ok, almost in front of my pc

aengelberg21:12:04

I'm trying out unravel for the first time but it doesn't seem to work with my basic socket repl:

unravel localhost 50505
evalmachine.<anonymous>:22
var reader = cljs.reader.push_back_reader.call(null,s);
                                         ^

TypeError: Cannot read property 'call' of undefined
    at unravel$lisp$safe_read_string (evalmachine.<anonymous>:22:42)
    at Transform._transform (evalmachine.<anonymous>:56:60)
    at Transform._read (_stream_transform.js:186:10)
    at Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:385:12)
    at writeOrBuffer (_stream_writable.js:371:5)
    at Transform.Writable.write (_stream_writable.js:288:11)
    at Transform.ondata (_stream_readable.js:642:20)
    at emitOne (events.js:115:13)
    at Transform.emit (events.js:210:7)

aengelberg21:12:41

I installed this with brew install, is there potentially a lumo problem at play?

aengelberg21:12:39

$ unravel --version
Unravel 0.2.2 (Lumo 1.7.0)

cgrand22:12:28

@aengelberg better build from source

cgrand22:12:29

(Give the packed-printing branch a try :-) and you have to launch it with —flag packed to enable it.