fennel-nvim icon indicating copy to clipboard operation
fennel-nvim copied to clipboard

todo: nrepl server + client

Open jaawerth opened this issue 4 years ago • 2 comments

Todo

Implement an nrepl client and an optional nrepl server (possibly forking jeejah that can plug into neovim's luv event loop.

This will allow both connecting vim to nrepl servers (Fennel and otherwise) for REPL-driven development features ala vim-fireplace, and connecting external nrepl clients to neovim's server to automate nvim.

The server may be overkill seeing as neovim already has a whole remote rpc api, but nrepl makes sense as a way to remote control nvim from Fennel and Lua and it would give you a full neovim REPL!

jaawerth avatar Oct 11 '19 03:10 jaawerth

You may also want to check out the prepl :smile:

  • https://oli.me.uk/exploring-repl-tooling-with-prepl/
  • https://oli.me.uk/clojure-prepl-for-tool-authors/

I'm the author of Conjure and I was considering doing exactly what your plugin does to replace the Lua and VimL in Conjure with Fennel. (most of Conjure is Clojure talking over RPC)

To experiment I was was going to write exactly what you've written here (although yours looks so much higher quality than what I was thinking of doing!). Glad I found your project first, I was going to call mine neovim-fennel :laughing:

Olical avatar Nov 10 '19 15:11 Olical

@Olical Interesting idea! I've poked at prepl a bit but to be honest i haven't really bothered to use it yet with Clojure - I'll have to give Conjure a spin. My main interest in using nrepl for this is that as a protocol it's designed to be language-agnostic, and there is already a small ecosystem for it in other langs. I could definitely see the benefit of eventually supporting both, though.

I'm leaning towards writing the nrepl stuff as its own lua/fennel module and just make it easy to plug in here; I initially wrote this plugin as a proof of concept of running fennel seamlessly in neovim, and I'm still working out how much I want to stick to just integration vs adding some IDE-lite stuff to allow using it as a dev platform for writing Fennel for neovim. It might be neat to add stuff to it to make it easy to, say, use the plugin to write, test, and precompile fennel-based nvim plugins like (possibly) Conjure.

And thanks for the kind words! If you use any of this (or simply follow a similar approach) while working on Conjure, I definitely welcome any and all feedback, PRs, etc based on what you find does and doesn't work. I'm working on stabilizing the API now in the dev branch (and reorganizing the files a bit), plus some much-needed vimhelp docs, then I'll probably start tackling the nrepl stuff.

jaawerth avatar Nov 15 '19 17:11 jaawerth