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



(I'm one of the authors of this tool)

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.


Is there any hope of going after even a subset of C++? I know the difference is enormous, I'm just asking the question.


We've only started pondering what subset of C++ we might be able to support in future work for the project. Currently only C is in scope. That's an obvious next goal but it seems quite a bit more daunting!


He doesn't appear to be a direct contributor, probably more of an inspiration. The only overlap I know of is that he also works/worked at Galois.

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
    -------------------------------------------------------------------------------


> The output of c2rust looks more like a literal projection from C into Rust, Corrode tried to limit the use of unsafe.

I don't think either statement is true. Both projects bill themselves as semantics-preserving translators, as in they try to generate Rust code which compiles and works the same way the original C code did (in fact corrode has a cc script which first compiles C to Rust then Rust to native).

Citrus is the literal projection: it's not semantics-preserving and usually doesn't generate compilable code.




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

Search: