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

The goal of C2rust is not to provide a usable code base per se, it’s to provide a convenient base for conversion: once the project is in unsafe rust it can be managed entirely via rust tooling and is hopefully a lot easier to finish up than if you keep having to redefine bindings as you move code from C to Rust.

C2rust is a springboard, if you move C2rust-Ed code to production you’re doing it very wrong.



On the other hand, if I have some working C dependency which I never intend to modify (owing to its complexity or stability), plopping the autogenerated Rust code simplifies your build step.

Not that it’s a good idea, but I could see a scenario where it would be worthwhile.


>"never intend to modify"

This is ideal state of affairs but sometimes the reality can interfere with our intents.


There are working projects out there whose source code is (at least partially) the output of tools like f2c [which converts Fortran to C].


Did I say move it to production? My question was that the generated code would me way more difficult to understand / modify than the original C.


> Did I say move it to production?

It was implied in your comment.

The point of C2rust is that the artifacts it generates are extremely transient, they don’t get modified they get replaced and if the rustified version is awkward or hard to grok you just get the C version from Git to validate your understanding, because it’s the exact same thing.




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

Search: