Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
borodi
· 4y ago · 0 comments
Theoretically yes, rust binaries can have C-apis and other code can call them just fine.
Comments
[–]
kibwen
4y ago
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.
[–]
hedora
4y ago
Also, no memory safety...
[–]
3a2d29
4y ago
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.