-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Success story running c2rust on h3 and some feedback #720
Comments
@LegNeato Thank you for taking the time to report a success story plus useful feedback. Very encouraging to read! re 1. please go ahead and file a task/PR. re 3-4. these items are very similar but seems to miss something. compile_commands.json does not capture linker invocations but at least one tool maintainer is interested in adding them in to support our use case. re 7. this is a bug; please file an issue so we can get this sorted. |
Great, I will try to get that all done this week. |
@LegNeato As a point of reference, how long did the translation take? I looked at your commit history, and it looks like all of your commits are on the same day, though I realize that you might have just batched them at the same time... |
The commit timestamps are realtime / they were not batched. I wasn't working 100% of the time though...went quick! |
Whoa, that's pretty impressive! It looks like it all happened in one day! I noticed one of the files had a lot of lines of code changed, but I guess that was just formatting some large arrays, and maybe you did some regexp find and replace or something like that? |
Yep, a lot of find and replace, a run with all clippy autofixes, some manual fixes, and rustfmt. |
(feel free to close, just wanted to give a success story and perhaps file bugs / open PRs for found issues)
I ran c2rust on h3 and it worked pretty well! Thank you! See https://github.com/LegNeato/unsafe-h3lib for the cleaned up output and the git history for what it took to get everything building.
I put some issues encountered in nmandery/h3ron#31 (comment) but the tl;dr is:
Questions/comments about the above:
rustfmt
. To me, it seems like this isn't really refactoring and instead is part of the translation. If you agree I can file a task and perhaps put up a PR.long double
varargs won't compile #154. But that doesn't mentionrust_decimal
. Isrust_decimal
with thec_repr
feature a potential path forward?PI
and such constants could be replaced? An argument could be made that it is refactoring, but I also think just as strong as an argument could be made that translating a well known constant in C to a rust std one is in the scope of the translator. For the second, clippy somehow knows themut
s were redundant but c2rust does not. Is that a bug I should file?std::ptr::null_mut::<T>()
instead of0 as *mut T
#202 was the main one. There were also a bunch of redundant returns generated, is that a bug I should file?The text was updated successfully, but these errors were encountered: