Hacker News new | ask | show | jobs
by pizza234 1191 days ago
This is true, but it still generates a (very) large amount of boilerplate and stylistically suboptimal code. Examples:

- the base unit is the individual C file, which causes structs and symbols to be duplicated across Rust modules

- for loops are translated to while loops with overflowing additions, which is ugly and unnecessary in pretty much every case (this makes sense, semantically, but it could be used only when necessary, not as general strategy)

- variables are declared at the top of the functions (AFAIR)

C2Rust generates code that requires significant refactorings _before_ semantic (C->Rust) translations - as a matter of fact, they had a refactoring tool, but it's been temporarily deprecated.

It's a fantastic tool, but as of now, it requires developers to write their own refactoring tools.