Fork me on GitHub
#unrepl
<
2017-05-21
>
plexus13:05:58

I'm a bit out of the loop on this one, can someone fill me in on what the status is of unrepl for ClojureScript? (bootstrapped or otherwise)

dominicm13:05:44

print.clj needs porting afaik

plexus15:05:47

ok so I'm having a go at this, using reader conditionals to smooth over the differences, but this is problematic because a regular clojure repl doesn't allow reader conditionals

cgrand15:05:10

@plexus not a problem. At the moment only Clojure REPL can be upgraded and I have control on the reader during the upgrade.

plexus15:05:44

so what about ClojureScript?

plexus15:05:03

[:unrepl.upgrade/failed]

RuntimeException Conditional read not allowed  clojure.lang.Util.runtimeException (Util.java:221)
user=> 

plexus15:05:37

Anyone know if there's a way to "compile" cljc to clj or cljs? i.e. to only expand the reader conditionals, but leave everything else as is?

cgrand20:05:14

@plexus just read with right options (see arity 2)

richiardiandrea15:05:00

@plexus if I understand right..the reader should read only the relevant parts so a cljs repl on nrepl+piggieback (you need a cljs repl I guess) should read the cljs part only. No need to get rid of the unwanted parts. It makes so much more sense to have it on bootstrap though (Lumo)

plexus15:05:32

yeah, the thing is that the reader refuses to do that

plexus15:05:50

it does it when reading from a CLJC file, but on the REPL it just throws an error when using reader conditionals

richiardiandrea15:05:09

Uhm odd, what is the error?

plexus15:05:18

Clojure: RuntimeException Conditional read not allowed

plexus15:05:27

lumo: #error {:message read-cond body must be a list, :data {:type :runtime-exception}, :cause #error {:message read-cond body must be a list, :data {:type :runtime-exception}}}

plexus15:05:56

I'm trying with rewrite-clj to scrub out the conditionals when building the blob

richiardiandrea15:05:52

Sounds like a syntax error somewhere, but I have never seen that..It can be anything

plexus15:05:09

well the clojure case very clearly says that it simply not allowed

cgrand20:05:47

@plexus well Clojure complains as soon as the ? is read it doesn't attempt to read further. So you could still have two problems (a syntax reported by cljs and a Clojure setup).

plexus15:05:59

so while some environments might accept reader conditionals fine it seems we can't assume that all will

richiardiandrea15:05:27

Uhm, but you are in a nrepl for the first and therefore if you have conditionals in cljc file only it should work...This is very odd indeed

plexus16:05:15

@cgrand could you say in a few words what you think needs to happen for unrepl to work on Lumo? I started porting print.clj to cljc, I thought that would be a good start, but I'm not sure how you see things or what else is involved

cgrand20:05:33

@plexus the hard part is the upgrade stuff. For explicitly started unrepl server the big missing part is print.cljc

cgrand20:05:09

Upgrading a stock cljs (self hosted) repl requires more work. I have one working with both lumo and a branch of Planck. I'd like it to go upstream but some issues with var bindings must be solved first.

cgrand20:05:51

For CLJ-hosted CLJS, I have no clear idea at the moment but several options to

plexus16:05:14

ok, I'm starting to see what you're saying. The blob instantiates a reader, so you have some leverage there as to how that behaves

mfikes20:05:58

@plexus if it helps with your reader conditional issue, Alex's lib might be of interest: https://github.com/aengelberg/cljsee

plexus09:05:20

mfikes: ha, good to know, I ended up implementing more or less the same thing https://github.com/plexus/unrepl/blob/lumo_support/src/unrepl/filter_cljc.clj

cgrand20:05:09

Upgrading a stock cljs (self hosted) repl requires more work. I have one working with both lumo and a branch of Planck. I'd like it to go upstream but some issues with var bindings must be solved first.