C2Rust: translate C into Rust code
c2rust.com
C2Rust: translate C into Rust code
1–10 of 79 posts
Re: C2Rust: translate C into Rust code
#2Re: C2Rust: translate C into Rust code
#3Re: C2Rust: translate C into Rust code
#4Missed opportunity to name it 'crust'
Edit: I think it was https://github.com/maidsafe/crust .
Re: C2Rust: translate C into Rust code
#5Re: C2Rust: translate C into Rust code
#6How’s this compare to https://github.com/jameysharp/corrode
c2rust is written mostly in Rust, Python and C where as corrode was written in Haskell. The output of c2rust looks more like a literal projection from C into Rust, Corrode tried to limit the use of unsafe.
$ tokei
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
-------------------------------------------------------------------------------
Autoconf 4 199 85 56 58
C 88 6989 5175 754 1060
C Header 21 2949 1497 1073 379
CMake 5 84 60 10 14
C++ 5 3015 2320 295 400
C++ Header 1 132 101 7 24
Dockerfile 1 62 50 6 6
HTML 2 84 78 0 6
Makefile 3 88 63 3 22
Markdown 23 1482 1482 0 0
Python 26 6597 4988 319 1290
Rust 250 45111 35949 2893 6269
Shell 44 697 429 141 127
Plain Text 15 555 555 0 0
TOML 11 197 148 24 25
Vim Script 1 233 195 4 34
-------------------------------------------------------------------------------
Total 500 68474 53175 5585 9714
-------------------------------------------------------------------------------Re: C2Rust: translate C into Rust code
#7How’s this compare to https://github.com/jameysharp/corrode
Our original plan was to simply work to improve Corrode. We eventually decided to to implement a new tool that uses Clang as the frontend in order to get more reliable parsing, preprocessing, and type checking of the input C code. The result is that we are able to support more code and C extensions than we thought we'd be able to building on top of the good work of the Corrode project.
Re: C2Rust: translate C into Rust code
#8How’s this compare to https://github.com/jameysharp/corrode
Re: C2Rust: translate C into Rust code
#9The insertion sort conversion example makes Rust look intimidating and verbose as compared to C :-).
Re: C2Rust: translate C into Rust code
#10The insertion sort conversion example makes Rust look intimidating and verbose as compared to C :-).
Translating the code into ugly, unsafe Rust is intended to only be the first step. We're working on tools to help with that refactoring process, too.