Hacker News new | ask | show | jobs
by maleldil 15 days ago
> translate it to Rust catching all the memory bugs in the process

That's not possible. If it were, you'd just fix the memory bugs directly in the original language.

Your best bet is to have a translation littered with unsafe blocks, so you still have to do the work of nailing down the specifics to make them safe. There's no magic "unsafe language" -> "safe Rust" pipeline, even with GenAI.

1 comments

You really think AI can't convert unsafe blocks to safe code?

The reason AI can't fix memory unsafety in the original language is the same reason humans can't do it. There isn't enogh feedback from the compiler.

I imagine it could, eventually, if not now. The Bun translation used Anthropic's best model, cost hundreds of thousands of dollars, and still contained a large number of unsafe blocks. Maybe if they left the agent running for longer, using Miri for verification?