← Back to context

Comment by tptacek

1 day ago

You're writing Rust, right? That's probably the answer.

The sibling comment is right though: it matters hugely how you use the tools. There's a bunch of tricks that help and they're all kind of folkloric. And then you hear "vibe coding" stories of people who generate their whole app from a prompt, looking only at the outputs; I might generate almost my whole project from an LLM, but I'm reading every line of code it spits out and nitpicking it.

"Hallucination" is a particularly uninteresting problem. Modern LLM coding environments are closed-loop ("agentic", barf). When an LLM "hallucinates" (ie: is wrong, like I am many times a day) about something, it figures it out pretty quick when it tries to build and run it!

I haven’t had much of a problem writing Rust code with Cursor but I’ve got dozens of crates docs, the Rust book, and Rustinomicon indexed in Cursor so whenever I have it touch a piece of code, I @-include all of the relevant docs. If a library has a separate docs site with tutorials and guides, I’ll usually index those too (like the cxx book for binding C++ code).

I also monitor the output as it is generated because Rust Analyzer and/or cargo check have gotten much faster and I find out about hallucinations early on. At that point I cancel the generation and update the original message (not send it a new one) with an updated context, usually by @-ing another doc or web page or adding an explicit instruction to do or not to do something.