3 ms·
> You have to sit down and essentially bang out a C header file as Rust extern “C” functions, using error codes, fancy ways to represent error conditions as inv
by zozbot234 4y ago
> You have to sit down and essentially bang out a C header file as Rust extern “C” functions, using error codes, fancy ways to represent error conditions as invalid return values (eg negative numbers) and all those tricks.
You have to do these things anyway if you want a Rust library to be accessible via C FFI, which is the preferred extern interface wrt. most programming languages. (Swift is an exception, since it was specifically designed to have a stable extern ABI).
- cormacrelf 4y agoThat is literally what I am describing.