Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Calling into C libraries from Rust is extremely easy

Calling the C function is not the problem here. It is dealing with the big data structure this function returns in a Rust-friendly manner.

This is something Protobuf does very well, at the cost of performance.



Writing Rust bindings for arbitrary C data structures is not hard. You just need to make sure every part of your safe Rust API code upholds the necessary invariants. (Sometimes that's non-trivial, but a little thinking will always yield a solution: if C code can do it, then it can be done, and if it can be done, then it can be done in Rust.)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: