Hacker News new | ask | show | jobs
by borodi 1446 days ago
Theoretically yes, rust binaries can have C-apis and other code can call them just fine.
1 comments

With the caveat that, naturally, these APIs can only expose concepts that C can understand, so you're a bit limited. No generics, for example.
Also, no memory safety...
Well its the C coding calling the Rust that has no memory safety, the rust code exposed as the C binary will (assuming no unsafe block) be memory safe, despite appearing to C like other C code.