Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Line by line is infeasible, which is precisely why you need to use AI to make larger semantic inferences.

You also don't have to one-shot translate everything. One of the valuable things about the Rust compiler is it gives lots of specific information that you can feed back into an LLM to iterate.

I've been working on similar problems for my startup (grit.io) and think C -> Rust is definitely tractable in the near term. Definitely not easy but certainly solvable.



What about convert to AST then ask the AI to convert to Rust. Would that work?


That’s probably the rout they would take, but the C AST won’t have ownership attributes. You‘d have to discover those yourself.

ASTs also don’t have much info on threading (that’s more or less limited to “the program starts a thread with entry point foo at some time”, “Foo waits for another thread to finish”)


Foundation models aren't primarily trained on ASTs, so you're typically going to have worse results than just using text unless you do extensive fine-tuning yourself.

ASTs also generally don't actually have magical information in them. They won't solve the lifetime issues for you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: