It's all good. For what it's worth, I agree with you generally that a lot of the C code I see is like, "differently shaped" than the Rust, so it's not super simple to port directly over.
This is cool, are there any downsides to calling Rust code from C? I guess it's basically a black box that behaves like a regular C library from the outside?
nothing, but a programmer who does so knows they are creating an abomination while in C, it's just a normal day. (and for anyone looking at the code, the rust version will look like a buggy mess, while the C version will look like correct C code).
The C version was ported to be the Rust one, it seems, and uses those intrinsics too. And, eventually this code will get to be a bit higher level while having the same output; those libraries are still a bit experimental though.
It is. I haven’t checked the complete source code. What I know for sure is that a program using Rust’s std still requires the C runtime to link and run, and from that perspective, it doesn’t really matter if some or even many parts of the std don’t actually use it.
The post does address this and shows their attempt to produce higher quality Rust. I've also seen it used to move off of a C toolchain and onto a pure Rust toolchain by porting C code to Rust.
reply