logoalt Hacker News

staredyesterday at 5:31 PM8 repliesview on HN

There was a recent discussion, “Why AI Needs Hard Rules, Not Vibe Checks” (https://news.ycombinator.com/item?id=46152838). We need as many checks as possible - and ideally ones that come for free (e.g., guaranteed by types, lifetimes, etc.) - which is why Rust might be the language for vibe coding.

Without checks and feedback, LLMs can easily generate unsafe code. So even if they can generate C or Assembly that works, they’re likely to produce code that’s riddled with incorrect edge cases, memory leaks, and so on.

Also, abstraction isn’t only for humans; it’s also for LLMs. Sure, they might benefit from different kinds of abstraction - but that doesn’t mean “oh, just write machine code” is the way to go.


Replies

crazygringoyesterday at 7:22 PM

That's a really, really interesting point.

It makes me imagine a programming language designed for LLMs but not humans, designed for rigorous specification of every function, variable, type, etc., valid inputs and outputs, tightly coupled to unit tests, mandatory explicit handling of every exception, etc.

Maybe it'll look like a lot of boilerplate but make it easy to read as opposed to easy to write.

The idea of a language that is extremely high-effort to write, but massively assists in guaranteeing correctness, could be ideal for LLM's.

show 3 replies
stargrazeryesterday at 5:34 PM

To go along with this, the ACM has a recent article on Automatically Translating C to Rust. It gets into the challenges of 'understanding code and structure' so that the end result reflects the intent of the code, not the actual execution paths.

https://cacm.acm.org/research/automatically-translating-c-to...

0xbadcafebeeyesterday at 10:55 PM

If it needs that many rules, why use AI at all? Linters pre-exist AI, don't cost money, and don't boil the oceans.

Look at Shellcheck. It turns a total newbie into a shell master just by iteration.

nylonstrungyesterday at 9:39 PM

Absolutely. A language being well suited to static analysis and "compiler driven development" matters a lot more with LLMs than with humans IMO

We're at the point of diminishing returns from scaling and RL is the only way to see meaningful improvements

Very hard to improve much via RL without some way to tell if the code works without requiring compilation

Logic based languages like Prolog take this to the logic extreme, would love to see people revisit that idea

jmullyesterday at 5:57 PM

Rust doesn't prevent programs from having logic errors.

If LLMs produce code riddled with bugs in one language it will do in other languages as well. Rust isn't going to save you.

show 8 replies
vbezhenaryesterday at 5:45 PM

Why Rust? Haskell is gold standard here.

show 3 replies
pathartlyesterday at 5:36 PM

I think it's a pretty good point. I've been using LLMs for .NET and the output is generally pretty good.

epsteingpttoday at 1:39 AM

agree 100%