Re:Pragmatic Bare Metal Rust
by steveklabnik on Tuesday May 19, 2015 @07:14PM
(#9573749)
> Some utility to assist bulk conversion from C to Rust would be nice
One of the problems with this is that Rust's guarnatees usually really affect your design. I'd imagine that a bulk C -> Rust translator would have to use `unsafe` all over the place.
Doesn't mean that it wouldn't be useful, but I wonder if slowly replacing APIs bit by bit isn't a better approach overall.
Yeah, the ease and mostly-cost-free nature of C-Rust interop is a really big selling point, as you can pretty much just drop Rust in piecemeal to replace your legacy libraries.
I think the better approach here is to phase out existing applications in chunks. You can link call rust code from C (when externed and rustc is told not to mangle) and C code from rust (via ffi).
My experience with code automatically converted has not been good.
[deleted]
Some utility to assist bulk conversion from C to Rust would be nice. That way Rust-based firmware could be reality in 2025. :-)