|
|
|
|
|
by kodoman
18 days ago
|
|
> Here is an example where I literally just told claude I wanted generic instances for these type classes and we had a brief back and forth about the approach then it one shotted this entire module Yes this is basically what I thought you where doing (what seems to me the correct thing). I have found it's very good at implementing interfaces or in your case type classes and completing generic functions. Though I am not sure if you wrote the type class definitions in this file or not, but sounds like either way you explained what you wanted. Also this sort of Haskell code is well above what I did in Haskell so I can only take your word for it that this is good code and I am sure it is. Though I always use plans like you, and found them to always be good. I have experimented with just asking it to implement features with minimal direct and it does end up being very bad. Particularly in creating data structures/ data types or interfaces and classes. My guess was only that when you try and get the agent to decide stuff like data types and type classes and how to structure the program it does a poor job and worse then if you did it in other languages. |
|
I picked an extreme example. Sadly I don't have a great example of more "business" style code in a public repo to show you right now, but I have had a lot of success using LLMs to write CRUDy haskell APIs and such as well.
I think LLM output quality is wildly dependent on how we prompt them. And I don't just mean giving a really specific design for it to implement or whatever. I have no real proof but suspect that every little thing about how we communicate to an LLM will impact the quality of the output. Like even just our choice of language in how we describe a problem.
I have a friend who is not remotely a programmer who tried to vibe code a big python project with Claude. He came up with really detailed designs and worked through them over and over with Claude. He hit some major roadblocks and asked me to look over the code. I was really shocked at the quality of the code out.
There was tons and tons of dead code, unnecessary repeated expensive computations, no real sense of an architecture, etc. I didn't even re-write it by hand, I just asked claude things like "decompose all the functions to a reasonable size", "use modules to organize the code", "remove dead code", "write pure functions", "parse dont validate", etc. It eliminated thousands of lines of crap, became way easier to read, and improved the speed of the program by orders of magnitude.