unrepl

discussing specification of an edn-based repl and its implementations.
2018-02-26T07:26:31.000165Z

It seems there is no request. Vim can dump the traffic. But there is nothing in the log. A try read also didn't get anything "stuck".

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.

cgrand 2018-02-26T11:43:17.000062Z

Ok, over the weekend I’ve worked on simplifying blob generation. The resulting blob is easier to read (for a human) and I guess the generator is easier to understand too.

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

cgrand 2018-02-26T12:36:59.000417Z

summary: 1/ find resources for the class and a source file (clj or else cljc) 2/ if .class is strictly more recent (or not found) then try to load it as a class [Comment #1] 3/ if sucess done 4/ if there was a source file, load it

cgrand 2018-02-26T12:38:28.000271Z

[Comment #1] great it means that classes go over the network twice, once for the timestamp (that we don’t provide and time is relative) once for actual loading [AOT sucks]

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:40:45.000042Z

It may explain why @gcast find loading libs through the network super slow (iirc you wree loading from an AOT compiled uberjar, no?)

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-26T15:23:24.000471Z

If anyone is looking for a project: mix https://github.com/djpowell/liverepl and unrepl

dominicm 2018-02-26T15:31:23.000539Z

that looks fun

gcast 2018-02-26T17:47:03.000384Z

indeed

2018-02-26T20:02:38.000729Z

@dominicm The code is now online. But it doesn't work, yet. Only manually sending stuff. And appending (part of) the response to the current buffer.

2018-02-26T20:02:59.000573Z

side loading works, though. 😄

2018-02-26T20:03:34.000449Z

https://bitbucket.org/kotarak/vimpire

1👍
dominicm 2018-02-26T20:19:23.000596Z

Very cool

2018-02-26T20:20:36.000349Z

EDN is a bit of a pain, though. In particalur the actions being actual clojure code.

2018-02-26T20:21:49.000064Z

Vim (and a lot of other languages, I fancy) doesn't have lists and vectors. Similar for symbols. So I had to introduce quite a bit of magic tagging to make these identifyable.

2018-02-26T20:22:18.000131Z

For normal data it might not be that of a big deal. You loose a bit. But for code things are not that easy. You mustn't loose info.

2018-02-26T20:22:48.000135Z

However, It should work now. Albeit inefficient and probably half-broken.

cgrand 2018-02-26T20:23:11.000154Z

I know this slippery slope, we went down it once. It ended with bencode.

2018-02-26T20:23:20.000604Z

I know.

cgrand 2018-02-26T20:24:31.000422Z

I think that @pesterhazy had to do some tagging even with cljs.

2018-02-26T20:24:45.000293Z

Huh?

cgrand 2018-02-26T20:25:40.000038Z

A vague memory

2018-02-26T20:29:10.000034Z

Anyway, the response works really well.

2018-02-26T20:29:30.000599Z

I'll probably need some load testing, but things are otherwise smooth.

cgrand 2018-02-26T20:29:49.000687Z

The response?

2018-02-26T20:30:04.000230Z

The side loading was very easy to implement, inparticular.

2018-02-26T20:30:10.000120Z

The response processing, I meant.

2018-02-26T20:30:44.000276Z

For the loader it was just to get things set up correctly.

2018-02-26T20:30:55.000541Z

Then it was a breeze.

2018-02-26T20:31:27.000061Z

Now I'll have to retrofit the asyncronicity to all kinds of interaction.

2018-02-26T20:31:55.000116Z

It should work for most. Eg. for doc lookup or macro expansion, one should not find a difference.

2018-02-26T20:33:27.000518Z

The only thing I already know will be troublesome is the completion.

2018-02-26T21:02:51.000484Z

It seems the internet delivered already on the latter. Although I always read "python". shiver

cgrand 2018-02-26T21:58:26.000566Z

???

2018-02-26T22:05:47.000535Z

Asyncronuous completion.

2018-02-26T22:06:34.000382Z

There seem to be some dark voodoo incantations to make it happen. So, off we go, Lord Samedi.

dominicm 2018-02-26T22:25:13.000077Z

@kotarak probably worth looking at hooking deocomplete and nvim completion manager

2018-02-26T22:52:51.000578Z

"python" is for me a no-go.

2018-02-26T22:52:59.000361Z

If there is a way without, we'll see.