logoalt Hacker News

zozbot234last Sunday at 10:08 AM1 replyview on HN

You can write a C-compatible binary library in Rust (see the cdylib target) and cbindgen can then generate proper C header files for any C-ABI interfaces exposed in Rust code. A full Rust-to-C compiler should only be needed for targets that have some C compiler available but are just not supported by the current Rust toolchain.


Replies

flohofwoelast Sunday at 11:02 AM

If you have an existing build system for your C project, you sure as hell don't want to bring another compiler toolchain (like Rust) into the mix.

show 1 reply