Fork me on GitHub
#conjure
<
2020-08-28
>
orestis06:08:08

Wrt to mappings etc, I’m always accidentally refreshing all my namespaces (I’m not sure what I’m pressing) which means I’m losing access to my (still running) http server which means I have to kill my repl to release the port 😞

practicalli-johnny15:08:18

If you loosing the reference to the app-server that is defined with def, using defonce instead should stop the namespace reload from changing the reference.

orestis16:08:33

I’m using defonce indeed. Some ways of roasting though (tools.namespace.refresh...) will completely throw away the namespace and start over.

practicalli-johnny17:08:11

Ah yes, that approach is more of a repl restart without restarting the repl.

orestis06:08:51

I would much prefer if Conjure exposed this kind of functionality as a command so I could invoke it manually, and then perhaps make my own keybinding as needed.

orestis06:08:33

I get providing keybindings for things like eval-thing-under-cursor, but most other things should be commands IMO.

Olical08:08:32

Hmm, I don't do this by default because I feel like giving a user a wall of things they could map means they won't because it's a fair bit of work and thought. So I like to do the thought ahead of time for you then give you the tools to opt out, hitting refresh accidentally is understandably annoying, I'm really sorry about that! One thing you could do is change all offending mappings to ["<plug>(ConjureRefresh"] then command ConjureRefresh <plug>(ConjureRefresh) or whatever the syntax is. That way it can only be invoked by command. (wrapping a mapping config in a table/array means it'll be unprefixed, so it won't have <leader> or whatever placed at the front) The alternative would be to map anything that's too easy to hit or is conflicting with things onto a harder to hit mapping. <prefix>rr is the refresh tooling I think? You could hit that when going for <prefix>er and missing the e, which is pretty rasy to do! You do make a very fair point, I guess I just went down the other side of the tradeoff path, I prefer to have it thought out and designed with the tools to change it if you disagree with my decisions. Sometimes I'll be wrong, of course!

3
Olical08:08:32

Hmm, I don't do this by default because I feel like giving a user a wall of things they could map means they won't because it's a fair bit of work and thought. So I like to do the thought ahead of time for you then give you the tools to opt out, hitting refresh accidentally is understandably annoying, I'm really sorry about that! One thing you could do is change all offending mappings to ["<plug>(ConjureRefresh"] then command ConjureRefresh <plug>(ConjureRefresh) or whatever the syntax is. That way it can only be invoked by command. (wrapping a mapping config in a table/array means it'll be unprefixed, so it won't have <leader> or whatever placed at the front) The alternative would be to map anything that's too easy to hit or is conflicting with things onto a harder to hit mapping. <prefix>rr is the refresh tooling I think? You could hit that when going for <prefix>er and missing the e, which is pretty rasy to do! You do make a very fair point, I guess I just went down the other side of the tradeoff path, I prefer to have it thought out and designed with the tools to change it if you disagree with my decisions. Sometimes I'll be wrong, of course!

3
orestis09:08:40

Thanks for the long and detailed response. I’ll look into unmapping some stuff the way you describe it. I completely understand wanting to offer some defaults as well. Perhaps a middle ground would be a variable (e.g. vim-better-default allows you to disable the keybindings if you set a global variable to false)

walterl11:08:26

@orestis How about let g:conjure#client#clojure#nrepl#mapping#refresh_changed = 'XRR' or something?

orestis11:08:37

Yeah @clojurians-slack100 I’ll do something like that for now.

walterl13:08:13

@olical OT: Conjure has piqued my interest in Fennel. I'm looking for a Clojure-y replacement for Python (mostly for writing CLI apps). Fennel's syntax with Lua's ecosystem seems like a good alternative. Having not used Fennel before, how well would you say it serves as a Python replacement? (Sorry for the OT question, but couldn't think of a more applicable channel.)

Olical13:08:36

You may want to look at Janet too! https://janet-lang.org/ Same author as Fennel (I think?), super similar, but it's own VM

Olical13:08:43

And full Conjure support

Olical13:08:10

Fennel + Lua on the CLI is a good option too, but I haven't added support for working with non Aniseed (see: running inside neovim itself) Fennel yet

Olical13:08:31

So Fennel inside nvim is okay with Conjure. Outside nvim in other processes has no support until I work something out.

Olical13:08:28

Making Fennel compiled/running outside of Neovim a first class client of Conjure is high up on my todo list

walterl13:08:20

Janet is an option, but one of the big issues is ecosystem. It's what Clojure nailed with JVM-support. Babashka is also great, but using it with third-party Clojure libs is (as I understand it) clunky, if at all possible. So Fennel's ability to use the Lua ecosystem seems like a major plus. Just to clarify: I'm not really asking about Conjure support for Fennel, but rather Fennel as a language (and ecosystem) for general scripting, on its own.

Olical13:08:05

Totally agree!

Olical13:08:23

But yeah, if you can solve the problem with Lua but want lispy syntax and macros, Fennel is fantastic!

Olical13:08:40

First class "Fennel but not inside neovim" support will be landing eventually 🙂

🚀 3
walterl13:08:52

Thanks for your feedback ❤️. If I get to use Fennel soon enough, maybe I can help with the Conjure support 🙂

Gargarismo04:09:08

Although I don't think it fits the bill as Clojure-y, there is a lisp-y language that transpiles to python ast, and is fully interoperable with python itself. It's called hy (https://docs.hylang.org/en/stable/). It's a great language, but it's a little young, and I bumped up against what I felt were limitations pretty quick.

Gargarismo04:09:28

Conjure doesn't touch it... yet.

walterl16:09:28

I've had a look at Hy and really wanted to like it, but there were a few language decisions that I just couldn't get past. Can't remember what they were, though 😕

walterl16:09:39

Maybe I should just try a project with it and see how it works in practice.

walterl16:09:01

In fact, maybe I'll try both Fennel and Hy for a nice comparison 🙂

walterl16:09:12

And babashka babashka

Olical16:09:49

Babashka seems fantastic for tooling

Olical16:09:56

We're using it a fair bit in anger I think

Olical16:09:01

To replace JS and bash things

Olical16:09:09

Conjure works with bb

walterl16:09:25

bb's limited ecosystem is my biggest gripe there. Otherwise it's really great.