started · updated
Fil-C ABI proposed to enhance Rust memory safety in C interoperability
A proposal has been made to improve memory safety when using Rust's C Foreign Function Interface (FFI) by adopting the Fil-C ABI. Currently, Rust developers must rely on unsafe boundaries when interacting with legacy C libraries, which can bypass Rust's compile-time memory safety guarantees.
Fil-C offers a different approach by recompiling C and C++ code with capabilities, runtime checks, and a concurrent garbage collector. This ensures that memory-safety violations result in a panic rather than an exploitable vulnerability. While Fil-C is source-compatible with C, it is not ABI-compatible with standard C.
Efforts to integrate this into the ecosystem include the use of Nix as a cross-compilation platform, which already provides ports for over 100 nixpkgs packages. Additionally, the Zig programming language is exploring a similar concept through a proposed optional Fil-inspired ABI.