unrepl

discussing specification of an edn-based repl and its implementations.
2018-02-25T07:31:08.000018Z

How serious is the SPEC about order of repl creation?

2018-02-25T07:32:06.000032Z

Currently it seems to expect (or recommend?) that the first connection is for user interaction.

2018-02-25T07:32:16.000036Z

And from there you create auxiliary repls.

2018-02-25T07:33:26.000031Z

As I understood the latter are more "affiliated" than "auxiliary".

2018-02-25T07:33:42.000069Z

So I would actually reverse the order of things.

2018-02-25T07:34:23.000038Z

The first connection would be actually immediately upgraded to a sideloader connection.

2018-02-25T07:34:31.000033Z

Followed by the second connection for control.

2018-02-25T07:34:58.000075Z

And then only the third connection would be the one for user interaction. (If I have that one at all....)

2018-02-25T07:36:28.000017Z

I would guess that it perfectly possible (the SPEC says "typically"), but I'd rather confirm this.

cgrand 2018-02-25T07:37:19.000012Z

Sideloader-Aux-user is not a possible order.

2018-02-25T07:37:31.000003Z

😕

2018-02-25T07:38:37.000025Z

Is there a specific reason why that is so?

2018-02-25T07:49:57.000059Z

aux-sideloader-user seems to be ok, does it not?

cgrand 2018-02-25T07:54:44.000057Z

Unless I overlook something aux/user are not technically different. It’s just a matter of ownership.

cgrand 2018-02-25T07:55:46.000048Z

I somehow expect tools to treat aux connections as a growing pool. Need to send a command but all connections busy? Spawn a new one!

2018-02-25T08:00:57.000003Z

Yeah. That was basically my question.

2018-02-25T08:01:12.000041Z

Whether I can use the first connection for non-user concerns.

2018-02-25T08:01:34.000003Z

The sideloader also has to be created relatively early so that I can require the tooling stuff.

2018-02-25T08:02:41.000035Z

whether the first is tooling and the second is sideloader or vice versa is not really the problem. I have to set up both anyway.

cgrand 2018-02-25T08:02:53.000061Z

I should (or better: you could, send more eyeballs to the code) double check there’s nothing special about “start-aux” upgrades except they share the sideloader.

2018-02-25T08:03:15.000035Z

I did and did not find anything special.

2018-02-25T08:03:33.000014Z

It just starts the repl other than creating the classloader setup.

2018-02-25T08:03:46.000081Z

Therefore rather "affialiated" than "auxiliary".

cgrand 2018-02-25T08:06:25.000018Z

Twin? Fork? Sibling?

2018-02-25T08:08:27.000013Z

sibling sounds nice.

2018-02-25T08:08:52.000126Z

It's not necessarily a twin. Because one could be tooling, one user interop.

2018-02-25T08:09:04.000015Z

Fork somehow sounds more disconnected.

2018-02-25T08:09:17.000008Z

I think sibling fits well. The same family.

2018-02-25T08:32:31.000056Z

I must be a masochist.

cgrand 2018-02-25T08:44:23.000058Z

Wasn’t your dedication to vim scripting enough of a hint?

2018-02-25T08:47:36.000001Z

I just the regular reconfirmation.

2018-02-25T08:47:40.000063Z

Vim me harder!

cgrand 2018-02-25T08:49:18.000031Z

The most difficult thing with vim is quitting.

2018-02-25T08:55:58.000063Z

Seems so. 😄 Haven't found my way out, yet.

2018-02-25T09:03:47.000074Z

Are there plans to define some :unrepl.tooling/doc-lookup &c. API?

cgrand 2018-02-25T09:03:49.000026Z

You might find this useful then https://itsfoss.com/how-to-exit-vim/

2018-02-25T09:04:31.000025Z

🙂 "pkill vim" from another terminal. 😉

2018-02-25T09:05:04.000118Z

(No. I'm currently not going to try, whether this actually works.)

2018-02-25T09:05:53.000028Z

API question regarding generic actions.

2018-02-25T09:05:59.000027Z

(The idea of a common tooling library coming back to my mind....)

dominicm 2018-02-25T10:42:17.000035Z

@kotarak where can I follow your work?

2018-02-25T14:09:11.000071Z

Soon here: http://bitbucket.org/kotarak/vimpire

2018-02-25T14:09:18.000073Z

But it's not there, yet.

cgrand 2018-02-25T15:44:40.000067Z

Previously each time the blob was sent it was creating new gensymmed namespaces. Now it always create the same namespaces unless they exist.

cgrand 2018-02-25T15:45:38.000077Z

Namespaces are named after their content so different code -> different name. Thus there’s no risk of clash.

👍 2
2018-02-25T17:53:15.000002Z

Hmmm.... It seems I cannot require through the side loader. It is not asked for the .clj file. Although it's listening after a side-loader/hello.

cgrand 2018-02-26T08:10:59.000176Z

Is your blob custom ?

cgrand 2018-02-26T08:13:57.000312Z

Did you try manually? May there be a buffer?

2018-02-26T08:45:07.000080Z

Used your stock blob. A buffer is not entirely ruled out. Just did some quick tests. I suspect some trouble on my side. That will be a pain to debug. sigh Will check deeper later today.

2018-02-26T12:03:02.000287Z

Result: one must not upgrade an unrepl to a side-loader.

2018-02-26T12:03:53.000009Z

Also: it asks always twice for the file?

cgrand 2018-02-26T12:04:16.000121Z

twice?

cgrand 2018-02-26T12:04:47.000351Z

Result 2: you may start getting what I was getting at when I was talking about upgrading from unrepl

2018-02-26T12:05:09.000379Z

Also: base64.... seems to have several interpretations.

2018-02-26T12:06:14.000070Z

It asks first for the class. Then for the clj. Then again for the class and again for the clj.

cgrand 2018-02-26T12:08:28.000171Z

not quite: 1/ do you have the class file? 2/ maybe the clj file? 3/ let’s be more general: the cljc file? 4/ just out of curiosity you wouldn’t have the class bytes in memory?

cgrand 2018-02-26T12:09:13.000310Z

half clojure/hald jvm behaviour

2018-02-26T12:11:44.000041Z

No class. Clj only. No cljc. And it asks weirdly for the first time for the class as :resource not :class. Tried to post a picture.

cgrand 2018-02-26T12:12:49.000382Z

classloaders can load resource or classes

cgrand 2018-02-26T12:12:56.000126Z

there are different things

cgrand 2018-02-26T12:13:58.000259Z

so :resource or :class keyword is there to convey this information

2018-02-26T12:17:41.000242Z

Yes. I understood. But it asks for the classfile as resource.

cgrand 2018-02-26T12:18:07.000136Z

@kotarak it wasn’t obvious but >>> 1/ do you have the class file? 2/ maybe the clj file? 3/ let’s be more general: the cljc file? 4/ just out of curiosity you wouldn’t have the class bytes in memory?

cgrand 2018-02-26T12:18:51.000322Z

was me paraphrasing clojure trying to load a ns

2018-02-26T12:22:30.000020Z

Then it could stop after two, could it not?

cgrand 2018-02-26T12:22:57.000277Z

which two? why? how?

2018-02-26T12:23:28.000191Z

In the main thread there is now also the picture...

2018-02-26T12:24:03.000335Z

Well, I provided it the clj file, no?

cgrand 2018-02-26T12:26:07.000068Z

How many times did you call require?

cgrand 2018-02-26T12:29:22.000075Z

the logic behind load

2018-02-26T12:39:31.000106Z

In the screenshot twice. The first for calls failed because base64. The second require w/ :reload caused the second four requests.

cgrand 2018-02-26T12:46:18.000017Z

I’m ok with revisiting the sideloading protocol to narrow it to have the same semantics as loading from several jars

2018-02-26T13:02:47.000309Z

Got it working. Problem was upgrade out of unrepl. Multi requests don't hurt. Further observation: base64 doesn't work from cli tool. More observation: Everything has to be newline terminated.

2018-02-26T13:15:11.000125Z

Fun fact: the EDN lib will be changeset 666. The signs are telling!

cgrand 2018-02-26T13:19:23.000241Z

vimpire buffer slayer

cgrand 2018-02-26T13:19:57.000227Z

gates of .el are opening

2018-02-26T13:29:34.000406Z

MUHARHARHAR

cgrand 2018-02-25T21:27:40.000097Z

Can you confirm?

cgrand 2018-02-25T23:11:09.000001Z

works for me, eg for (require ’foo.bar)

~$ nc localhost 5555
user=> (unrepl.repl$aNSc1LtUH91sIAn6Wgp$CUFDTME/attach-sideloader! :session505)
[:unrepl.jvm.side-loader/hello]
[:resource "foo/bar__init.class"]
nil
[:resource "foo/bar.clj"]
nil
[:resource "foo/bar.cljc"]
nil
[:class "foo.bar__init"]
nil

gcast 2018-02-25T23:19:19.000116Z

just thought I'd give an update regarding an issue I experienced in the past where Datomic transactions, if evaluated at repl, would cause Unrepl clients to crash. It turns out that the return value of Datomic transactions contain an object which effectively points to the db and when this object is dereferenced it will completely dump the entire database on screen. My current guess is that perhaps whatever elision is being done on the transaction may somehow be dereferencing the db object and dumping out all the datoms