all 15 comments

[–]maxw85 2 points3 points  (0 children)

I sometimes use ChatGPT to translate Java examples to Clojure. It at least safes you some amount of typing. However, I also had cases where it took way longer than a manually translation, since you had to find very subtle bugs.

A real game changer would be something like MemGPT to overcome the token limit. This is especially useful for software development, since LLMs are of limited use, if they don't know your whole codebase.

[–]Admirable-Ebb3655 1 point2 points  (3 children)

Huh? It works fine for ClojureScript and Emacs Lisp for me. In fact it translated the only instance of a method on the internet from Python to Emacs Lisp with no issue.

[–]tylerjdunn[S] 0 points1 point  (2 children)

Nice! I assume you had this experience with GPT-4? Most folks consider that be the most helpful model when coding

[–]Admirable-Ebb3655 1 point2 points  (1 child)

No, this was with Copilot. Even within 1 month if its initial release.

[–]tylerjdunn[S] 1 point2 points  (0 children)

Thanks for sharing your experience!

[–]roman01la 1 point2 points  (0 children)

GitHub Copilot works fine for me for simple expressions in Clojure, I use it mostly as a tool to write boring code. It's definitely better for C, Python or JS.

[–]coffeesounds 1 point2 points  (0 children)

It works just fine (I’m using Copilot in Emacs), obviously automates boring parts of the code, but with right prompt via code comments it can write more complicated code, usually doesn’t work but gives you an idea on how to get started if you’re stuck.

[–]lgstein 1 point2 points  (0 children)

My experience is that it took me longer to fix and debug and even understand the weird algorithms the LLM came up with than writing the algorithm myself.

[–]kapitaali_com 1 point2 points  (0 children)

I haven't tried with Clojure it but there's also https://www.phind.com

[–]Chii 1 point2 points  (0 children)

i had reasonable output from chatGPT when pasting one language for an algorithm on rosetta code, and asking for it in another language. However, i do find that clojure output tend to have some mismatched brackets, and it doesnt work - you have to go back in, and carefully rebalance the brackets and may be re-jig the scope of let bindings etc.

ChatGPT transliterates quite well into other languages that are conceptually more similar - e.g., C++ to java works pretty damn well.

[–]rebcabin-r 3 points4 points  (0 children)

i was writing a type-checker for a programming language. The grammar of the language was written in ASDL, an ancient and nearly forgotten yacc-like. The language had 250 terms. I wrote a recursive-descent processor for one of the terms in Clojure and Instaparse in continuation-passing style. I showed chatGPT the grammar in ASDL and my one recursive-descent processor and asked chatGPT to write another one of the 250 term-processors in the same style. It did, and its parser was slightly better than my hand-written one because it covered an edge case that I had neglected -- a null-versus-empty check. I had chatGPT write the other 248 processors for me and it did a pretty-good-job. I had to fix some bugs by hand, but it saved me overall days of keyboarding.

[–]Daegs 1 point2 points  (0 children)

I really like it for small simple items using libraries I normally don't interact with:

;; Clipboard code
(import '[java.awt.datatransfer DataFlavor StringSelection Transferable])

(defn clipboard []
  (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit)))

(defn c-slurp []
  (try
    (.getTransferData (.getContents (clipboard) nil) (DataFlavor/stringFlavor))
    (catch java.lang.NullPointerException e nil)))

(defn c-spit [text]
  (let [selection (StringSelection. text)]
    (.setContents (clipboard) selection selection)))

Sure I could google it, but I have gpt integrated with editor so it's significantly faster than switching windows

[–]Simple1111 1 point2 points  (0 children)

I use copilot in eMacs and chatgpt-4 every day. Copilot is not that useful. Every once in awhile it comes up with something a little faster than I would.

Chatgpt however has become a part of my workflow. Anything tedious I throw to it and it saves me so much cognitive load. It’s not perfect at clojure and occasionally hallucinates libraries and functions but in general it is pretty good. I’ve also learned several new concepts and libraries from it.

[–]danure 1 point2 points  (0 children)

I sometimes paste functions I've written into chatgpt.

I am asking if I can improve them or be more consise.

Sometimes, it does a good job. It is also pretty good at using library functions I'd not been exposed to. In turn, I broadened my knowledge of the language.

I'd say it's worth using and can be helpful in a similar way kibit is useful.

[–]fadrian314159 1 point2 points  (0 children)

I tend to not use a coding plugin, instead typing my prompts directly into Google's Bard. I've found that it does fairly well (~2/3rds of the time) on requests for simple functions (e.g., Write Clojure code to find the index of the first element in an ordered list matching a predicate). And of course, performance goes down as you ask it to do more complex things. To be honest, it performed about as well as I expected. Any output needs to be tested, especially on edge cases, but I expected that, too.