3 ms·
> This is compiling C into very unsafe Rust as a target language It’s basically as safe as the original. > This isn't translation into usable Rust It’s sligh
by bluejekyll 8y ago
> This is compiling C into very unsafe Rust as a target language
It’s basically as safe as the original.
> This isn't translation into usable Rust
It’s slightly more usable, and easier, than FFI to raw C (see other comments about Cargo integration).
I’ve been thinking about language rewrites like this, and generally I’m really torn. If it’s the intention to get rid of your C, it might in fact be easier to use bindgen for the C header translation, and create decent Rustful interfaces that abstract the C. After that maybe use this tool as a starting point to get Rust or possibly just rewrite the section by hand. In either case you’ll be rewriting the logic into safe Rust at some point, otherwise I don’t see a huge point in doing this (other than the Cargo integration, though there are other options for that).