chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
seancorfield 2019-11-06T00:52:44.211Z

If you use in-ns on a namespace that doesn't exist, you won't get of clojure.core. I suggested doing a conditional check on find-ns (and then either in-ns if it exists or ns if it doesn't) but I don't know how portable that is. There are definitely some REPLs it won't work with.

seancorfield 2019-11-06T00:53:08.211500Z

If you were able to do load-file first then the problem goes away of course 😐

mauricio.szabo 2019-11-06T01:07:01.212900Z

Probably the problem is here: (clojure.core/->> res type str...

mauricio.szabo 2019-11-06T01:08:30.213500Z

I'm just amazed that somehow I didn't test this case.... I'll fix it 🙂

mauricio.szabo 2019-11-06T01:19:21.213800Z

This is the problem: https://github.com/mauricioszabo/repl-tooling/commit/fcb1fb0323c55dc1b3206c44a553575643dc853b

2019-11-06T01:42:23.216400Z

i think what seancorfield said about in-ns for a non-existing ns may still be an issue even with that change. i just tested by changing my source manually in my submodule checkout of repl-tooling and then did a npx shadow-cljs watch dev (that should be enough right?), with the change, there is still an error:

user=> #object[Namespace 0x1941fb1e "sample"]
Syntax error (InvalidOperationException) compiling at (REPL:4:642).
Unable to resolve symbol: str in this context
sample=> 
please let me know if there is something else i still need to do to test the latest change.

2019-11-06T01:44:54.217200Z

looking at a wireshark capture, it doesn't look like the change got compiled in -- need to figure out how to build this correctly...

mauricio.szabo 2019-11-06T01:45:21.217700Z

Please save the file clj_helper.clj

mauricio.szabo 2019-11-06T01:46:37.219100Z

All files on resources path are inlined on this clj_helper. Saving it once will issue a compilation and things should work

2019-11-06T01:52:09.220300Z

thanks, that seems to have done it 🙂 seems to be working! :thumbsup:

#?(:cljs :using-cljs-repl :clj :using-clj-repl :cljr :using-cljr-repl :joker :using-joker-repl :bb :using-bb-repl)
:using-unknown-repl
user=> user=> :using-cljr-repl
user=> :using-unknown-repl
user=> (in-ns 'sample)(try  (clojure.core/let [res (do (ns sample) (def a 1) )  res (clojure.core/cond  #?(:cljs false :default (clojure.core/ratio? res))  (clojure.core/symbol  (clojure.core/str "#repl-tooling/literal-render \""  (clojure.core/pr-str res) "\""))  (clojure.core/symbol? res)  (clojure.core/symbol (clojure.core/str "#unrepl/bad-symbol [nil "  (clojure.core/pr-str (clojure.core/str res))  "]"))  (clojure.core/keyword? res)  (clojure.core/symbol (clojure.core/str "#unrepl/bad-keyword ["  (clojure.core/pr-str (clojure.core/namespace res)) " "  (clojure.core/pr-str (clojure.core/name res))  "]"))  (clojure.core/->> res clojure.core/type clojure.core/str (clojure.core/re-find #"Big(Decimal|Float)"))  (clojure.core/symbol (clojure.core/str "#unrepl/bigdec "res))  (clojure.core/->> res clojure.core/type clojure.core/str (clojure.core/re-find #"BigInt"))  (clojure.core/symbol (clojure.core/str "#unrepl/bigint "res))  :else res)]  ['tooling$eval-res 'G__2 {:result (clojure.core/pr-str res)}])  (catch System.Exception e  ['tooling$eval-res 'G__2 {:error (clojure.core/pr-str e)}])) 
#object[Namespace 0x3629912d "sample"]
[tooling$eval-res G__2 {:result "#'sample/a"}]
sample=> 

2019-11-06T02:00:02.221300Z

i guess as long as one uses full-qualified names, clojure.core things should be available.

mauricio.szabo 2019-11-06T02:14:52.221800Z

If something is required at least once, they become available with their full-qualified names 🙂

mauricio.szabo 2019-11-06T02:15:26.222400Z

Now I'm trying to cut some strange code that are appearing when I evaluate code...

2019-11-06T02:15:49.223Z

right

2019-11-06T02:18:26.224400Z

since there is a connection to the socket repl, i guess it's safe to assume clojure.core has been (mostly?) loaded

mauricio.szabo 2019-11-06T02:25:07.224900Z

Yes, so far it seems like so...

mauricio.szabo 2019-11-06T02:25:23.225400Z

there are so many strange things happening on different REPLs that I'm not betting on it 😄

mauricio.szabo 2019-11-06T02:26:04.225900Z

(for example, in-ns in ClojureScript is bizarre....)

2019-11-06T02:39:09.226100Z

right

mauricio.szabo 2019-11-06T03:13:28.227400Z

Also, I just discovered that load-file in CLJS also suffers from the same problem...

dpsutton 2019-11-06T03:21:17.228Z

i'm copying the lein invocation from https://atom.io/packages/chlorine and i'm getting

[dan@fedora queue]$ JVM_OPTS='-Dclojure.server.myrepl={:port,5556,:accept,clojure.core.server/repl}' lein trampoline repl
ClassCastException java.lang.String cannot be cast to java.lang.Number
	nrepl.server/start-server/addr--1161 (server.clj:120)
	nrepl.server/start-server (server.clj:128)
	nrepl.server/start-server (server.clj:96)
	reply.eval-modes.nrepl/get-connection (nrepl.clj:158)
	reply.eval-modes.nrepl/get-connection (nrepl.clj:156)

dpsutton 2019-11-06T03:22:25.228500Z

the example for clj works correctly for me though

seancorfield 2019-11-06T03:29:35.229100Z

@dpsutton That error is coming from nREPL, not the Clojure Socket REPL (just FYI)

seancorfield 2019-11-06T03:30:06.229800Z

And that command works for me -- so perhaps some problem with your project.clj or maybe ~/.lein/profiles.clj?

dpsutton 2019-11-06T03:30:20.230200Z

thanks @seancorfield. hmm. i thought i had emptied those 🙂 rookie mistake if not ha

2019-11-06T03:32:02.230600Z

i'm getting the same error output, fwiw

dpsutton 2019-11-06T03:32:30.231Z

hmm, no ~/.lein/profiles.clj file for me

2019-11-06T03:32:40.231500Z

my is pretty blank

dpsutton 2019-11-06T03:32:42.231700Z

is there a system one lurking anywhere? I always forget

2019-11-06T03:32:57.232100Z

or close to anyway

seancorfield 2019-11-06T03:33:07.232300Z

FWIW, that's with lein 2.8.1 on OpenJDK 8 in a random example project.

dpsutton 2019-11-06T03:33:26.232800Z

i'm 2.9.1. let me downgrade

seancorfield 2019-11-06T03:33:26.232900Z

I have no ~/.lein/profiles.clj file.

2019-11-06T03:33:28.233Z

here it was w/ lein 2.9.1

2019-11-06T03:33:50.233400Z

tried both openjdk 8 and adoptopenjdk 11

dpsutton 2019-11-06T03:34:03.233700Z

works with lein 2.8.1 broken lein 2.9.1

seancorfield 2019-11-06T03:34:53.234500Z

I haven't upgraded Leiningen for ages because so much stuff seemed to be breaking for other people 😐

dpsutton 2019-11-06T03:34:54.234600Z

welp, time to debug nrepl. thanks for the datapoint though @seancorfield

seancorfield 2019-11-06T03:36:01.235800Z

(this is yet another instance of why I'm glad I've stopped using nREPL and tooling built on it -- the move out of Contrib and the renaming and ripples it caused have been -- and continue to be -- quite disruptive, it appears)

seancorfield 2019-11-06T03:36:36.236400Z

I've seen a number of people have problems with Leiningen 2.9.x and downgrade to 2.8.x and it's fine ¯\(ツ)

2019-11-06T03:36:55.236600Z

nice to be able to downgrade 🙂

2019-11-06T03:38:13.237600Z

w/o trampoline works here

2019-11-06T03:39:13.238300Z

and connecting via socket repl from chlorine w/ eval selection worked too

2019-11-06T03:41:04.238700Z

may be it's worth mentioning that trampoline + lein 2.9.x might have issues in README.md?

mauricio.szabo 2019-11-06T03:45:32.239600Z

Yes, I'll just remove the trampoline part, seems that it's a regression (I remember having the same problem with some older version of lein)

dpsutton 2019-11-06T03:46:14.240Z

seems like reply is calling start server with port "0" instead of nil or 0

mauricio.szabo 2019-11-06T03:53:20.241800Z

Another issue, now with Clojure.CLR: I was debugging why Chlorine is not rendering the exception correctly... and just discovered that #error, on ClojureCLR, just returns an invalid map 😞

mauricio.szabo 2019-11-06T03:53:39.242200Z

The keyword :message is empty, so there's an odd number of arguments

2019-11-06T04:03:35.242600Z

which version of clojure clr are you testing with?

mauricio.szabo 2019-11-06T04:03:48.242800Z

4.0

2019-11-06T04:04:42.243200Z

i mean, when you do _*clojure-version_* what do you see?

2019-11-06T04:05:22.243800Z

is it 1.9.x or something off of the master branch?

mauricio.szabo 2019-11-06T04:05:30.244Z

1.9.0

2019-11-06T04:06:05.244700Z

ok -- if you tell me exactly what code, i can try to see what happens for something close to 1.10

mauricio.szabo 2019-11-06T04:08:50.245Z

(try (throw (ex-info "FOO" {}))
  (catch Exception e e))

2019-11-06T04:09:47.246100Z

for something on master (1.10 snapshot), i get:

#error {
 :cause "FOO"
 :data {}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message 
   :data {}
   :at [System.Diagnostics.StackFrame invokeStatic "NO_FILE" 0]}]
 :trace
 [[System.Diagnostics.StackFrame invokeStatic "NO_FILE" 0]]}

mauricio.szabo 2019-11-06T04:09:48.246200Z

On my REPL it returns #error {:cause "FOO" :data {} :via [:message :data {} :trace [....]]}

mauricio.szabo 2019-11-06T04:10:10.246700Z

Yes, the same invalid map... 😞

2019-11-06T04:13:42.247300Z

i see the problem in core_print.clj

mauricio.szabo 2019-11-06T04:13:45.247500Z

By the way, tomorrow I'll try to release a new version with these changes: https://github.com/mauricioszabo/repl-tooling/pull/40

👍 1
2019-11-06T04:15:06.248200Z

is missing

2019-11-06T04:18:33.249Z

looking forward to trying out the ones i haven't 🙂

seancorfield 2019-11-06T04:39:05.249600Z

@sogaiu I reported that on JIRA for you https://clojure.atlassian.net/browse/CLJCLR-106

2019-11-06T04:39:32.250Z

@seancorfield tyvm!

2019-11-06T04:40:34.251Z

i think the discovery was by mauricio.szabo though :)

seancorfield 2019-11-06T04:41:17.251200Z

Updated 🙂

2019-11-06T04:48:24.251700Z

thanks again :)

borkdude 2019-11-06T07:33:30.252100Z

nRipple

1
henrik 2019-11-06T11:43:25.252300Z

Does the latest Chlorine print UUIDs weirdly?

mauricio.szabo 2019-11-06T11:56:01.254100Z

I didn't change that code, but I'll look at it and add a test case and fix it :)

👍 1
henrik 2019-11-06T13:18:27.255200Z

Can you reproduce it?

mauricio.szabo 2019-11-06T13:19:19.255400Z

Yes, I can. I think it was some change in some clojure version...

henrik 2019-11-06T13:20:16.255900Z

Ah, that might be it.

mauricio.szabo 2019-11-06T22:02:50.257200Z

Just published a new Chlorine version, fixing problems with evaluation on ClojureCLR, adding support for load-file in ClojureCLR (didn't test on Windows yet), and fixing the UUID issue too 🙂

2019-11-06T22:14:53.257700Z

success with load file followed by eval selection with clojure clr :thumbsup:

mauricio.szabo 2019-11-06T22:16:13.258700Z

Great! If things become more stable with this new code, I hope I can simplify the current code for REPL connection and other issues 🙂

2019-11-06T22:16:36.259100Z

i have my fingers crossed 🤞

2019-11-06T22:18:09.259400Z

ooo, load file works with babashka too 🙂

2019-11-06T22:52:54.260700Z

is there an easy way to test delayed sending of the second form when connecting? the first form is a reader conditional, and the second form is the keyword :using-unknown-repl. i'd like to send the second one possibly after receiving the response for the reader conditional.

2019-11-06T22:59:56.262400Z

to give some background, i'm testing with arcadia -- and although there are packets flowing to arcadia / unity and prompts coming back, there are no evaluation results. the socket repl there is a bit customized. may be there are timing issues.

2019-11-06T23:00:41.262800Z

manually sending the same reader conditional sequence followed by the keyword via nc works.