Replies: 2 comments 1 reply
-
Having played around with the various AI tooling a bit, I think this is a great idea. I've been doing mainly two things:
For both of these I find the Copilot Chat interface the best. Getting incremental inline completions to write substantial amounts of code is not the way to go, but that was how the original copilot worked. The problem I have with copilot chat is:
Aider does a few things that I really like:
|
Beta Was this translation helpful? Give feedback.
-
I found this via #emacs-devel today, which could be interesting when building something specialized for Clojure. |
Beta Was this translation helpful? Give feedback.
-
A clojure-specific "gpt mode" would seem nice / better than context-switching to chat.openai.com. For instance, one could send the buffer's
ns
form as part of the prompt, so that GPT produces a new one that is a merge of your stuff + suggested stuff.(Otherwise, having to adapt top-level
(require '[,,,])
calls into thens
form is fairly cumbersome)The response could be the whole new contents of your .clj file: existing + suggested contents. i.e. the buffer contents are replaced, you only hit save if you're happy.
Other bits of context that could be sent would be project.clj/deps.edn (so that it knows which libraries are preferred) or, who knows, maybe all your .clj files (with obvious IP concerns - I'd only do this if there was something like a .gpt-allow empty file at the project root)
Here's a POC session:
https://chat.openai.com/share/31edefae-845c-4ceb-abe9-64dcd95b473f
The way I thought of implementing this was at cider-nrepl level. Doing stuff with a Clojure backend seems better than a pure-elisp impl since:
As mentioned, client-side, the impl could be as simple as replacing the whole buffer. But an agnostic backend can leave the choice open for more detailed clients.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions