unrepl

discussing specification of an edn-based repl and its implementations.
cgrand 2017-11-16T11:09:27.000068Z

I’m happy to announce that sideloading support in unravel is complete.

cgrand 2017-11-16T11:09:59.000130Z

Start a plain old repl:

Clojure 1.8.0
user=> (require ’[net.cgrand.xforms :as x])
FileNotFoundException Could not locate net/cgrand/xforms__init.class or net/cgrand/xforms.clj on classpath.  clojure.lang.RT.load (RT.java:456)

cgrand 2017-11-16T11:11:14.000022Z

Now connect unravel to it with additional entries on the classpath:

$ scripts/run -cp .:$HOME/.m2/repository/net/cgrand/xforms/0.9.5/xforms-0.9.5.jar:$HOME/.m2/repository/net/cgrand/macrovich/0.2.0/macrovich-0.2.0.jar 5555
Unravel 0.2.2 connected to localhost:5555

Type ^O for full docs of symbol under cursor, ^D to quit
Enter #__help for help

user=> (require '[net.cgrand.xforms :as x])
nil
user=> (x/into {} (x/by-key odd? x/count) (range 10))
{false 5, true 5}
EDIT: It’s worth noting that xforms requires macrovich. So recursive requires are supported “for free” (without any support at the sideloader level)

dominicm 2017-11-16T11:12:07.000138Z

oh, wow, it works with jars too. That's basically what would be needed by CIDER. That's amazing. I'm sure @benedek and @bozhidar would be excited by this.

cgrand 2017-11-16T11:12:20.000419Z

Btw nothing prevents a client from extending a classpath dynamically

dominicm 2017-11-16T11:12:57.000336Z

yeah, for sure.

dominicm 2017-11-16T11:13:22.000183Z

I mean, in theory you could say "I will handle any require of replant.XXXXXX" and load it with x, y and z functions.

cgrand 2017-11-16T11:13:35.000292Z

The 34 lines of the sideloader are there https://github.com/Unrepl/unravel/blob/sideloader/src/unravel/loop.cljs#L290-L324

cgrand 2017-11-16T11:15:04.000118Z

yes on missed require you could ask the user if they want to perform a repo lookup and add the dep etc.

cgrand 2017-11-16T11:19:32.000036Z

I’ve been rambling with the sideloader idea for so long (and having struggled to communicate it), that I’m happy to see it works

cgrand 2017-11-16T11:25:06.000158Z

> I (@dominicm) just didn’t understand the gap between jar and base64 encoded class. you are asked for a resource, you open the zip (jar), check if the resource is in it, if found you extract it, base64 it and send it

dominicm 2017-11-16T11:34:24.000228Z

I might attempt something like this for juxt/edge's training mode. It's quite nice to not have to worry people with require's whilst we're getting them to grips with the foundations of the language.

cgrand 2017-11-16T12:44:49.000211Z

@pesterhazy @volrath @dominicm Does anyone remember what I proposed for autocomple: prefix, suffix returns a list of maps? I think there was a third argument

cgrand 2017-11-16T12:47:23.000126Z

namespace! that was the 3rd one, right?

dominicm 2017-11-16T12:52:08.000121Z

if it wasn't, it probably should be

dominicm 2017-11-16T12:52:47.000080Z

although, doesn't unrepl know the current ns?

cgrand 2017-11-16T12:53:36.000280Z

if you complete for a file that you are editing out of the repl buffer, no

cgrand 2017-11-16T12:54:10.000101Z

Logbot is on vacation since Oct 20th so...

dominicm 2017-11-16T12:54:14.000198Z

ah, I see.

dominicm 2017-11-16T12:54:26.000110Z

slack is increasingly not the best place for this I suppose.

cgrand 2017-11-16T12:54:51.000155Z

this being the whole clojurians thingy?

dominicm 2017-11-16T12:56:34.000242Z

Slack, yes. Not to repeat discussions elsewhere, with much heat, but Slack's business model doesn't align with community's much. I'm not advocating for a move, I think the sheer # of people far surpasses many of the costs.

➕ 2
pesterhazy 2017-11-16T15:53:49.000212Z

@cgrand, yes, namespace I think

cgrand 2017-11-16T16:00:00.000397Z

thanks for the confirmation

dominicm 2017-11-16T22:05:06.000277Z

If I haven't aot'd my clojure code, I suppose I can't do a base64 of the class. Is that reconcilable?

cgrand 2017-11-16T22:27:11.000223Z

Base64 of the ns should be enough. Except if you try something fancy.

cgrand 2017-11-16T22:31:35.000434Z

@dominicm despite the name classloaders load more than classes

dominicm 2017-11-16T22:32:17.000209Z

Awesome. I thought it was very jvm centric, cool to hear that it isn't.