4 ms·
> Please consider not vibe coding rust as AIs are not good at writing Rust and also hire a real rust dev Isn't the whole point of AI companies using Rust that
by jadar 5mo ago
> Please consider not vibe coding rust as AIs are not good at writing Rust and also hire a real rust dev
Isn't the whole point of AI companies using Rust that it's explicit, safe, and AIs are fairly good at writing it?
- minimaxir 5mo agoI suspect "Rust is fast/low memory utilization" is the more common value proposition, with memory safety as the bonus that can push it over other fast languages. Related: If AI writes your code, why use Python? (which notes why Rust has taken off for LLMs) https://news.ycombinator.com/item?id=48100433 https://news.ycombinator.com/item?id=48100433
- chrisco255 5mo agoZig is every bit as fast with typically even lower memory footprint as Rust. The main thing Rust promises that Zig cannot already do natively is memory safety. This is not about Python vs Rust. It is one systems language vs another.
- minimaxir 5mo agoThis Rust rewrite instance is explicitly about memory safety by admission of the devs; I was just commenting on the trend.
- surajrmal 5mo agoNotably the rewrite managed to also both reduce binary size and reduce compile time. Given it's largely a straight non idiomatic migration, that's surprising to me.
- chrisco255 5mo ago-9MB on Win/Linux and unchanged on Mac. It wasn't a 100% pure idiomatic migration there was some cleanup done.
- jadar 5mo agoI would imagine that the strong type system would also help steer AIs to ensure that code is written correctly. The compiler supplies backpressure to the agent that steers it toward a more correct program.
- skippyboxedhero 5mo agoAI is not good at writing Rust. The ways in which it is bad vary from writing code that just looks off to actually not working. I do not use unsafe frequently so cannot comment on this particular scenario but I have seen similar stuff often, most Rust code that I read from AIs has at least one or two issues. In particular, if you have a situation that requires any kind of conceptual understanding then AI will likely have issues. Sync blocking async is the classic example. My theory is that humans make this worse because they will often prompt in a certain direction and AI will faithfully build the footgun.
- conradludgate 5mo agoI haven't experienced these issues with latest models writing performant and correct rust fwiw. It does seem to understand Rust's safety concepts quite well when working on reviewing or writing code
- jadar 5mo agoCouldn't you say that about any code written by AI in any programming language, though? You might as well say "AI is bad at writing code".
- skippyboxedhero 5mo agoNo, the distinction with Rust is obvious from the comments on this post by people who have actually used Rust...but the features of the language are such that you need to have some deeper conceptual understanding to use those features effectively. Cpp is the same. Opus writes Rust like someone coming from Python, it is very obvious if you have a lot of hours in the lab...most people do not.