Generating and linking from C against a Rust library on Windows

I started working on xi-lib, which aims to provide a simple C interface to xi-editor. My initial research was focused on building a C library in Rust. The Rust FFI Rust offers a powerful FFI interface. We can easily use extern "C" fn to create functions that can be called from C. A simple example: #[no_mangle] pub extern "C" fn test() { println!("hello world"); } Using #[no_mangle] ensures that the compiler does no additional name-mangling, allowing us to call this function from C, while extern "C" ensures that the function gets exported.
Read more