Live data from Hacker News

If you're going to vibe code, why not do it in C?

stephenramsay.net

551–560 of 626 posts

Re: If you're going to vibe code, why not do it in C?

#551

Vibe coding should be done in Python, and probably only in Python. If a project is important enough to require C or x86 assembly, where memory management and undefined behavior have real consequences, then it’s important enough to warrant a real developer who understands every line. It shouldn’t be vibe coded at all. Python’s “adorable concern for human problems” isn’t a bug here, it’s a feature. The garbage collecti…

> The moment you need C’s performance or assembly’s precision, you’ve crossed into territory that demands human accountability. I disagree. I write a lot of one-off numerical simulations where something quick and dirty is useful but performance matters and the results can be easily verified without analyzing every line of code. Python would be a terrible choice.

You'd be hard pressed to do any really damage with numerical simulations outside of NaN propagations. C's problems come from the standard library

Re: If you're going to vibe code, why not do it in C?

#552

My experience of vibe coding is that the agent makes as many mistakes as me, it just types faster than I do. So using the most safe and typed language possible is still a good idea. Also I want to understand the code as much as possible - sometimes the agent overcomplicates things and I can make suggestions to simplify. But if it's writing in a language only it can understand, that's going to be harder for me.

I think the author's point is that if you even try to understand the code, you haven't fully embraced vibe coding.

Re: If you're going to vibe code, why not do it in C?

#553
Practical argument for vibe coding in C: the training corpus is probably much higher quality.

C code that survives in the wild tends to be written by experienced devs who care about correctness. The JS corpus includes mountains of tutorial code, Stack Overflow copypasta, and npm packages with 3 downloads. In my experience, generated C is noticeably better—and this might be why.

Re: If you're going to vibe code, why not do it in C?

#554
great read so as i have understood to why ai is generally good at web dev and not so good at other low level stuff is "more data to train better the model". So model trained on the whole web > a model particular trained on a single language (in this case c). and i also think you can't go lower than C in this case, since below that the code is architecture specific and so even less data to train on. would love what others think

Re: If you're going to vibe code, why not do it in C?

#555

Practical argument for vibe coding in C: the training corpus is probably much higher quality. C code that survives in the wild tends to be written by experienced devs who care about correctness. The JS corpus includes mountains of tutorial code, Stack Overflow copypasta, and npm packages with 3 downloads. In my experience, generated C is noticeably better—and this might be why.

How well can LLMs reason about avoiding UB? This seems like one of those things where no matter how much code you look at, you can still easily get wrong (as humans frequently do).

Re: If you're going to vibe code, why not do it in C?

#556

Earlier quoted context omitted.

I use rust. The compiler is my agent. Or to quote Rick and Morty, “that’s just rust with extra steps!”

Replace memory with one of the dozen common issues the Rust compiler does nothing for like deadlocks.

Well, the case would still stand, wouldn't it? Unless C is free of these dozen common issues.

Re: If you're going to vibe code, why not do it in C?

#557
post #317

Earlier quoted context omitted.

Thanks. I meant is more of in a joking way, poking fun at the community. I know I'm far too young to earn a gray beard, but I hope to in the next 20-30 years ;-) I still got a lot to learn till that happens

You wish, that gray beard sometimes appears in your late thirties.

Hit me pretty quickly after turning 40 (now 50)... in this last decade I've gone mostly bald and my facial hair is now mostly gray.

Re: If you're going to vibe code, why not do it in C?

#558

Earlier quoted context omitted.

Rust does not have manual memory management, and its type system also has the property that if your program compiles it probably works, IME.

I hear this about both Haskell and Rust, and yet, when I tried both in the former I wrote a useless program because I didn't handle state (and yet passed all tests!) while in the latter I immediately wrote a deadlock. So...yeah.

It is still possible to write bugs in both Haskell and Rust.

Re: If you're going to vibe code, why not do it in C?

#560

Earlier quoted context omitted.

Actually it's the classic "inductive reasoning has to meet a set of strict criteria to be sound." Criteria which this does not meet. Extrapolation from a sample size of one? In a context without any LLM involvement? That's not sound, the conclusion does not follow. The point being, why bother making a statistical generalization? Rust's safety is formally known, deduction over concrete postulates was appropriate. > it…

I never claimed to be doing a formal proof. If someone said "traffic was bad this morning" would you say "have you done a scientific study on the average journey times across the year and for different locations to know that it was actually bad"? > LLMs produce worse results in than humans We aren't talking about whether LLMs are better than humans. Also we're obviously talking about Rust code that compiles . Code th…

I didn't claim that you were doing formal proofs. You can still make bad rhetoric, formal or not. You can say "The sky is blue, therefore C is a memory safe language" and that's trivially inferred to be faulty reasoning. For many people bad deduction is easier to pick up on than bad induction, but they're both rhetorically catastrophic. You are making a similarly unsound conclusion to the ridiculous example above, its not a valid statistical generalization. Formal or not the rhetoric is faulty.

> would you say "have you done a scientific study on the average journey times across the year and for different locations to know that it was actually bad"?

In response to a similarly suspiciously faulty inductive claim? Yeah, absolutely.

> We aren't talking about whether LLMs are better than humans.

The point I'm making here is specifically in response to the idea that it would "be surprising" if LLMs produced substantially worse code in Rust than they did in C. The paper I posted is merely a touch point to demonstrate substantial deviation in results in an adjacent context. Rust has lower surface area to make certain classes of vulns under certain conditions, but that's not isomorphic with the kind of behavior LLMs exhibit. We don't have:

- Guarantees LLMs will restrict themselves to operating in safe Rust

- Guarantees these specific vulnerabilities are statistically significant in comparative LLM output

- The vulnerability severity will be lower in Rust

Where I think you might be misunderstanding me is that this isn't a statement of empirical epistemological negativism. I'm underlining that this context is way too complex to be attempting prediction. I think it should be studied, and I hope that it's the case LLMs can write good, high quality safe Rust reliably. But specifically advocating for it on gut assumptions? No. We are advocating for safety here.

Because of how chaotic this context is, we can't reasonably assume anything here without explicit data to back it up. It's no better than trying to predict the weather based on your gut. Hence, why I asked for specific data to back the claim up. Even safe Rust isn't safe from security vulnerabilities stemming from architectural inadequacies and panics. It very well may be the case that in reasonably comparable contexts, LLMs produce security vulnerabilities in real Rust codebases at the same rate they create similar vulnerabilities in C. It might also be the case that they produce low severity issues in C at a similar statistical rate as high severity issues in Rust. For instance, buffer overflows manifesting in 30% of sample C codebase resulting in unexploitable segfaults, vs architectural deficiencies in a safe Rust codebase, manifesting in 30% of cases, that allow exfiltration of everything in your databases without RCE. Under these conditions, I don't think it's reasonable to say Rust is a better choice.

Again, it's not a critique in some epistemological negativist sense. It's a critique that you are underestimating how chaotic this context actually is, and the knock-on effects of that. Nothing should surprise you.

Post reply on HN