Fork me on GitHub
#conjure
<
2020-04-11
>
martinklepsch12:04:29

So nice to catch up on this channel, I just tried :help conjure-intro and nothing came up, but damn, I’m excited! 🙌

Olical12:04:58

Yeah, sorry, it'll be there soon 😅

Olical12:04:09

I want all docs to be in vim this time

martinklepsch12:04:54

No rush, no rush!

sogaiu12:04:00

is it true that conjure reads the .nrepl-port content to decide on a port to listen on?

martinklepsch12:04:06

I’m just messing around a bit 🙂

martinklepsch12:04:20

@sogaiu that’s what it seems to be doing currently, yes

sogaiu12:04:37

lein deletes .nrepl-port on exit afaict

sogaiu12:04:55

so how to work with this file seems kind of confused

sogaiu12:04:27

creating .nrepl-port and putting a port number in it and starting lein doesn't seem to affect the port lein chooses to listen on

sogaiu12:04:41

it just goes ahead and chooses another port number and writes over the existing file

martinklepsch12:04:21

well you’d need lein running so conjure can connect to something, no?

sogaiu12:04:46

i don't think so

sogaiu12:04:56

the new conjure doesn't need lein iiuc

Olical12:04:17

It needs you to start an nREPL at the moment, yes (@U050TNB9F) so you need an nREPL and .nrepl-port file

sogaiu12:04:48

sorry getting muddled 😅

Olical12:04:55

I haven't added commands to connect to any arbitrary port yet (that's easy and soon), so to connect to bb you need to create a .nrepl-port file yourself

Olical12:04:08

which sucks, but I'll add the command / mapping soon!

martinklepsch13:04:52

Really not that big of a deal for now!

sogaiu12:04:04

and i don't think the old one used nrepl

martinklepsch12:04:34

I just upgraded my Conjure to develop and am connected to a CLJS repl and I can see stdout (which hasn’t been working with shadow + fireplace). I’m sold! 😄

👍 8
🎉 4
Olical12:04:39

Yay! Yeah, there's still issues with piggieback CLJS and stdout but I've reported them on the repo

Olical13:04:00

You will lose stdout on reconnection for example, which is super annoying.

Olical13:04:24

I think doc lookup doesn't work through piggieback either because the stdout goes to the wrong session id. Figwheel may be much better, I haven't tried yet.

martinklepsch13:04:18

My repl use is pretty simplistic so I’m not too worried about doc etc

martinklepsch12:04:07

the old one didn’t use nrepl but the new one does. and the nrepl server has to be started somewhere.

sogaiu12:04:46

iiuc, conjure has its own implementation

sogaiu12:04:52

babashka has its own

martinklepsch12:04:57

previously conjure also didn’t start nrepl servers on it’s own IIRC

sogaiu12:04:39

sorry i'm geting confused

martinklepsch12:04:39

as in you specified a port number in .conjure.edn but it was largely up to you that an nREPL server is running at that port

borkdude12:04:03

if conjure works with bb, please report it here: https://github.com/borkdude/babashka/issues/344

martinklepsch12:04:17

@borkdude I’ll give it a test run

Olical12:04:36

Yep, so you run your own nREPL server (I will probably add jack-in at some point) and it only works by .nrepl-port file right now.

Olical12:04:46

I will add the command to connect to any host:port soon!

Olical12:04:55

Then you can set up your own mappings to connect to different REPLs

Olical13:04:41

You can use those to work out which keys do what until I write it up 😬 (pretty bad, but still)

Olical13:04:07

Mappings wrapped in tables/lists like ["K"] mean it's unprefixed. Just a little DCL for config.

Olical13:04:55

And bb worked last time I tried 😄

Olical13:04:08

Although sessions were a bit funny, like I couldn't list them.

borkdude13:04:32

I didn't implement that yet, only discovered it exists now 🙂

Olical13:04:41

Yep, I use it extensively to ensure the user is always connected to an existing session.

Olical13:04:55

So when you connect it checks if there's an existing one and re-assumes that session.

Olical13:04:12

If you kill all sessions then it'll go "oh no, I don't have one and there's none to assume so I'll make a fresh one"

Olical13:04:22

But yeah, it's a really useful op 🙂

borkdude13:04:05

I don't understand the use case completely. When you do clone, you get a new session id. When do you want to see the other session ids?

Olical13:04:15

To jump between sessions

Olical13:04:39

If I reconnect to an nREPL server I can list the existing ones (which might have a server process in it I want to go interrupt and restart)

Olical13:04:07

It also means if I have piggieback cljs running then my neovim crashes, all I have to do is reopen neovim and I'm back into cljs land.

Olical13:04:41

I'm planning on adding ways to name sessions from Conjure too which will mean you can be like "this is my server, this is cljs, this is the main clj eval one"

Olical13:04:50

(that won't require support from bb)

Olical13:04:09

Wonderful, thank you! I think it's a really useful op

Olical13:04:18

Although I don't think many clients use it in the way I'm thinking right now?

martinklepsch15:04:35

Not sure if you’re asking for bug reports on Conjure develop but I noticed that session-select fails with this when connected to a shadow-cljs nrepl server

; conjure.lang.clojure-nrepl error: .../.vim/plugged/conjure/lua/conjure/lang/clojure-nrepl.lua:912: attempt to call field 'input' (a nil value)

Olical15:04:29

Ah that's annoying, probably to do with shadow's ls-sessions working differently,at a guess?

Olical15:04:42

It's just inconsistencies between nREPL implementations I think :thinking_face:

martinklepsch15:04:06

It’s not that big of a deal for me really, I’m fine just using session-next and session-prev

Olical15:04:22

Oh I think I know what that is

martinklepsch15:04:44

Overall this is really amazing, I’m really excited to use this going forward

martinklepsch15:04:51

Showing the session type in the session list would be pretty cool

Olical15:04:23

And pushed

Olical15:04:32

Was just a wrong function named call.

Olical15:04:07

And yeah, planning on adding meta data to sessions such as names (maybe auto generated with human readable things by default) which show up instead of the uuid

Olical15:04:20

For now you'll just have to get fairly good at pattern recognition with UUIDs 😅

martinklepsch15:04:47

verified your fix :thumbsup:

🎉 4
Olical15:04:57

I think the naming system will be automatic by default, so I'll mash together a few random words (like "correct horse battery staple"), but you can manually rename if you want

Olical15:04:07

This will allow you to have a session for your webserver for example

Olical15:04:17

Which you can hop into, interrupt and restart if you want.

Olical15:04:43

Something I haven't really seen in any other clients so far but maybe I'm missing something. Sessions seem super useful but I've never really seen them exposed much?

martinklepsch15:04:43

I never bothered to look into sessions in Cider, I just disconnect and reconnect if I want to go back from cljs to clj, but on my current project I’m also mostly using cljs so not too important to be able to go back

Olical15:04:18

Hopefully this will allow you to hop between them if you need to 😄

Olical15:04:04

I haven't got all the magic of "execute the code in the right connection via a series of complex rules", I don't think it's required

martinklepsch15:04:20

The autogenerated names sound like a great idea, may I suggest: use a single word & have a theme for clj and cljs sessions, e.g. clojure is colors (blue, white, …) and clojurescript is tools (hammer, saw, …)

Olical15:04:42

The problem is you won't know what type a session will be when you create it. It becomes CLJS via piggieback.

martinklepsch15:04:03

Yeah I actually like the manual switching but that may only be due to some oddness in my current project. I wonder if maybe there should be a warning of some kind though, when evaluating forms from a .clj buffer to a cljs session

Olical15:04:30

:thinking_face: maybe, although you might want to, so a warning would be a strong as it got I guess

martinklepsch15:04:03

right, I actually read that code just now but would it be too complex to just collect this information before listing sessions?

Olical15:04:59

I'm keeping sessions simple until I give them some love really. Once I start attaching metadata it'll get easier.

Olical15:04:13

Would be cool if I could have some sort of stable uuid -> name conversion

Olical15:04:20

with minimal collisions

Olical15:04:40

Maybe city names from around the world mapped into an evenly divided space :thinking_face:

Olical15:04:56

I think I'll do that, so you get to discover random city/town names while playing with sessions 😅

👍 4
💡 4
Olical15:04:09

Then I'll probably find a way to attach the REPL type to the side eventually

Olical15:04:17

And then allow custom names at some point

rafaeldelboni16:04:09

Hey @olical I'm pretty excited with the new conjure, even more with the idea of multiple languages in the same tooling, I may finally give Racket a try haha But regarding backward compatibility, you planning to make it smooth? Or it will break everything when you swap the master branch for sourcery? I actually don't care if I need to do a setup again, but I care for the Mappings, they will be the same? Sorry if you said this before.

Olical16:04:14

I'm trying to make it as smooth as possible, but there will definitely be things you need to adjust to. I mean the lack of .edn config files and prepl for starters. The mappings however are basically exactly the same as before, how you configure them will be different but not too much. You just have to set some values in Lua now (I might provide some viml based helpers so you don't need to write any Lua interop)

Olical16:04:49

Config, nREPL and HUD over virtual text are the main changes

Olical16:04:08

There's no build step required now either, so hopefully it'll be easier than the current master version

👍 4