News for hackers. Stuff that matters.
Re:How to rewrite it in Rust by zozbot234 on Monday December 02, 2019 @08:37AM (#21682160)
> When converting C to Rust you have to do things on a module by module or compile artifact by compile artifact basis, which makes it much more challenging.

OP is essentially about proving the opposite. It does take a bit of setup to get there, but you can ultimately translate C to Rust on a function-by-function basis, and Rustify interfaces, data structures, etc. only gradually after nothing on the C side is relying on the older defs.

C++ would be more of a challenge - you need to forgo quite a few C++-exclusive features to end up with interfaces that Rust can work with. That's where an "artifact by artifact" approach might work better. Other languages would be roughly similar, with their heavyweight C FFI's.

Re:How to rewrite it in Rust by saagarjha on Monday December 02, 2019 @11:46AM (#21684095)
> you need to forgo quite a few C++-exclusive features to end up with interfaces that Rust can work with

Luckily, many C++ projects do this already so they can be called from C.

Re:How to rewrite it in Rust by Sammi on Monday December 02, 2019 @08:42AM (#21682197)
Sorry for the ninja edit. I've updated my comment. I meant to discuss how it works out of the box with Typescript, but takes more work with Rust. Seriously impressive that it can be done though.