Fork me on GitHub
#conjure
<
2021-08-04
>
harryvederci07:08:17

It may be a bit much, but I think setting the option conjure#eval#result_register to * will always copy the result to your clipboard.

๐Ÿ™ 2
Olical07:08:35

I use that โ˜บ๏ธ

harryvederci15:08:20

Say I've got a project structured like this:

example
|-- a.fnl
`-- nested
    |-- b.fnl
    `-- more-nested
        `-- c.fnl
When using Conjure for Aniseed projects, Conjure seems to always be aware of the context in which it should be running. I guess that's because of this: (module example.a {autoload {nvim aniseed.nvim}}) (or (module example.nested.b {autoload {nvim aniseed.nvim}}) for the nested one) Question: Is there a way to get that same "intelligence" when setting conjure#filetype#fennel to "conjure.client.fennel.stdio" ? So for a non-Aniseed project? If I would then do this:
$ cd example/nested
$ nvim b.fnl
Conjure will not be aware of the fact that it's part of the example project, right?

Olical12:08:15

Yeah there's no way to do this since fennel / lua has no concept of module aware evals unlike Clojure and it's ns system ๐Ÿ˜ž that's why I added the module system (which some people reaaaaly dislike), so we could get that context.

Olical12:08:41

You have to treat it as one big global REPL right now sadly, not sure how I can get around that right now

Olical12:08:50

Maybe I'll think of something some day!

harryvederci12:08:57

Alright! I like the idea of the module system, it's just that it's an extra abstraction on top of Fennel (new to me) on top of Lua (also new to me) + Neovim (also new to me)

Olical12:08:17

Possibly when I work on my new project that will wrap the fennel REPL in an nREPL client that may be able to add context aware evals in a clever way ๐Ÿ‘€ but you'll have to stay tuned for that. It'll be a companion project with a stand alone binary you wrap your REPLs with (like rlwrap) which adds rich REPL support to many different non-Clojure REPLs that Conjure can hook into easily.

Olical12:08:38

It'll be called replica so look out for it ๐Ÿ˜›

harryvederci12:08:56

How about Janet? That language has relative imports. Can Conjure understand it should then reason about things from the file where the cursor is at?

harryvederci13:08:52

So if I'd be in example/nested/b.janet and that would contain (import ../some-other-file) there, can Conjure understand it'll have to grab example/some-other-file.janet?

Olical13:08:09

Janet has the same problem I think? That the Janet REPL is one big global state?

Olical13:08:44

We use netrepl to connect to Janet I think, but I'm preeeety sure it's still just one big global space.

Olical13:08:59

I think the relative imports should work though?

Olical13:08:24

but again, global shared REPL space, so names will collide

Olical13:08:47

My ideal scenario will be my REPL relay tool thing adding support for "namespace" like things to as many langs and REPLs as I can, even if that means starting sub-repls within the plain stdio REPL, kinda like how unrepl etc work. So when it start up it will inject a sub-repl that can support contexts.

Olical13:08:13

But I need to sit down for a couple of weeks and build some magical thing to make this happen, can someone invent a time machine for me, please?

harryvederci13:08:48

I had to run eval-file instead of buffer!

Olical13:08:18

Yeah! Buffer sends the contents directly to the REPL which means paths are interpreted from CWD

Olical13:08:23

Not dir of source

Olical13:08:04

Again, can't hack that afaik, we'll see what mad science comes out of replica, but not yet.

harryvederci13:08:29

And I can probably create something that does this every time I jump to another file

harryvederci13:08:41

I think that solves it for me!

Olical13:08:07

Yep! Something I don't do by default because if your file says "run me to delete filesystem", you probably don't want to run it when you open it. You're more than welcome to autocmd though!

harryvederci13:08:15

> can someone invent a time machine for me, please? Well it's about time I donated to you, so you can regard it as funding for either Conjure or a time machine. Your choice!

Olical13:08:40

If you can donate a TARDIS I'll have everything done yesterday.

harryvederci13:08:09

Judging by the fact that it wasn't, I think I won't ๐Ÿ˜›

๐Ÿ˜„ 3
Olical13:08:49

But that'll be massively appreciated, even if it's a coffee a month worth, or less! Every little helps on my road to being full time on my OSS passion projects within 10-30 years ๐Ÿ˜…

harryvederci13:08:29

Hmm true that. Maybe I'll do something like keeping a file with "trusted" files. Or I'll just be lazy. I prefer to call it "brave", though

harryvederci13:08:29

(and have a prompt in the autocmd)

Olical13:08:50

Hey, if you don't write dangerous top level forms, you do you!

โœ… 3
harryvederci13:08:28

What's your preferred way of receiving donations? I'll rather do a one-time but slightly bigger donation for now than something where I have to create an account and all that.

harryvederci13:08:07

Wait, I'll ask that in the main thread to get more people thinking about donating ๐Ÿ˜„

thanks3 3
harryvederci15:08:20

Maybe I could solve that with a example/.lnvim.fnl file that sets the conjure#filetype#fennel value and starts the REPL with something like fennel ./a.fnl ? Not sure if that would work, and if I'd unknowingly still be using some Aniseed things under the hood. (What I want to prevent is situations where things work fine in Conjure because of Aniseed, without me knowing they'd break in normal Fennel.)

Olical13:08:10

Yeah! You could use some clever autocmds + ConjureClientState (search :h conjure for this) where you have a different REPL per buffer! But then you can't communicate between them ๐Ÿ˜ž

martinklepsch19:08:14

(ClojureScript/shadow) One thing Iโ€™ve been running into again is that somehow async evaluations lose *out* and so any println in the .then part of a promise arenโ€™t printed to the REPL buffer. Iโ€™ve found some workarounds with tap> and atoms and whatnot but I wanted to ask if this is to be expected or if itโ€™s a bug or just not possible to really get right? ๐Ÿ™‚

Olical13:08:39

I think that's a cljs bug of sorts? Like the prns come out in a different context so nREPL doesn't capture them and send them out, they bypass nREPL

Olical13:08:12

Same problem when you reconnect to a CLJS nREPL for the 2nd time, nREPL has a kind of bug in it (or the CLJS layer does anyway) so that the stdout is still going to the first nREPL session which you may not have access to anymore.

Olical13:08:45

I don't remember the exact details, but cljs+nrepl+stdout has always had issues for me ๐Ÿ˜ž at the nREPL level itself, not sooo much in Conjure. I really need to add tap> support to Conjure though! That'll help a lot!

Olical13:08:35

There's an issue for that, but I'm struggling for time / energy to get my day job and life under control right now, so I'm not in the right place to put in extra time on Conjure right now ๐Ÿ˜ž Looking to move to a 4 day work week and maaaaybe get Clojurists Together funding if I'm lucky, so that would help!

martinklepsch18:08:19

Ah interesting, that makes sense. Do what you need to do ๐Ÿ™‚ I hope Clojurerists Together funding comes through, Iโ€™ve been rooting for you every time grants were allocated ๐Ÿ™‚

martinklepsch18:08:34

Do you happen to know if thereโ€™s an issue somewhere that tracks this?