6 ms·
AI 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 s
by skippyboxedhero 5mo ago
AI 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.