arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

FAQ

hashtag
Why isn't my type definition translated?

Types that aren't used to generate code are pruned away. Try using your type in a function declaration.

hashtag
Why isn't printf available?

You'll need to include headers to use functions from external libraries.

hashtag
Why was my function omitted?

When the translator can't handle a translating a function for some reason it omits the implementation and prints the reason. This is configurable and visible when you're running the tool locally. Currently this web interface doesn't show warning messages generated during translation.

hashtag
What are the known limitations?

We've captured many of the features we don't support on the wiki page.

Known Limitations of Translationarrow-up-right

Documentation

The C2Rust manualarrow-up-right is available online and is our comprehensive documentation for using and developing C2Rust.

hashtag
Learn More

More information about installing c2rust from crates.ioarrow-up-right is availble in this introductory blog post:

Introduction to C2Rustarrow-up-right

Per Larsen recently presented a talk on C2Rust at RustConf detailing both our approach to translation as well as our cross-checking approach to testing the resulting translations.

Eric Mertens wrote a blog post describing some of the challenges we encountered during translation of C to Rust and how C2Rust tackles them.

RustConf 2018 - C2Rust: Migrating Legacy Code to Rustarrow-up-right
C2Rust Challengesarrow-up-right

C2Rust

hashtag
From C to Rust, to Better Rust

Many of the most important systems in the world are written in inherently unsafe languages such as C, the memory-related vulnerabilities of which expose a significant attack surface for hackers. It would be beneficial to rewrite these languages in safe-by-design languages, such as Rust, but migration of a real system by hand is enormously expensive and time consuming.

This is why, for more than a decade, Galoisarrow-up-right and Immunantarrow-up-right have been developing C2Rust, our automatic migration tool that is able to translate most C modules into semantically equivalent Rustarrow-up-right code.

Click the link below to try C2Rust for yourself!

Our original C2Rust transformed C code into unsafe, C-like Rust code. This is the first step of migration, but ultimately, we want Rust that is safe, performant, and idiomatic.

The current state of the art is to run C2Rust, and then for an expert team to migrate the rest of the way. Immunant have done exactly this on the migration of the dav1d codec library to Rust. The next step, currently in active development, is to create an automated migration tool that can fully transform C code to safe, performant Rust.

Even as the C2Rust continues to improve, it is already being widely used — for example, the popular serde_yaml crate is just a wrapper around c2rust-transpiled code. No matter your current tech stack, there are effective ways to integrate C2Rust into your workflow.

This project is available under the .

hashtag
Download C2Rust

Source code and instructions are available in our .

hashtag
Contact

To report issues with the translation or tool, please use our

For more information, email us at


BSD-3 licensearrow-up-right
git repositoryarrow-up-right
Issue Tracker →arrow-up-right
[email protected] →envelope

C2Rust Demonstration →