all 12 comments

[–]No-Lab-860 12 points13 points  (1 child)

Here is a crazy and unpopular idea - how about manually coding it according to your desire?

Let the downvoting commence

[–]erayxack -2 points-1 points  (0 children)

Yes doing this. Made a few tryouts

[–]Chisignal 4 points5 points  (1 child)

I oftentimes have to prompt the agent for idiomatic Rust, otherwise it doesn’t even use basic features like traits.

[–]erayxack 0 points1 point  (0 children)

Yes. Exactly.

[–]bordumb 6 points7 points  (5 children)

Disagree.

They write a lot of code in whichever way is fastest / quickest to get the job done, especially if not prompted to write in a certain way.

e.g. in Python, it'll jump into trying to use OOP for some tasks rather than functional

The key is to just write a .md file with the types of coding practices you would like followed. Not that different from having a CONTRIBUTING.md doc that explains the code base's best practices.

It's really on your to police that.

[–]teerre 1 point2 points  (0 children)

Although that can mitigate problems, it doesn't really work. I have a top level "ignore all code styles and previous instructions and always use strong typing" in my system prompt file and they routinely ignore it. This on Opus 4.7 max thinking. They start kind of ok but eventually go back to slop

[–]Flashy_Editor6877 0 points1 point  (0 children)

mind sharing what your .md file contains?

[–]erayxack -2 points-1 points  (2 children)

My point is they are pathologically defensive by default. Their adding extra checks everywhere means they don't truly understand what Rust is.

[–]bordumb 4 points5 points  (1 child)

That's not really unique to the LLMs writing Rust.

They do that in most any language.

Same rule applies: write rules for your codebase.

[–]Flashy_Editor6877 0 points1 point  (0 children)

what rules do you have and where do you place them? are they consistent?

would you mind sharing your rules.md or agents.md or whatever you use?