equilibrium-ffi 0.3 · MIT · Rust + C ABI
Load foreign code with one call
Point equilibrium at a source file — V, Zig, C, C++, C#, Rust, D, Nim, Odin, Hare, or TypeScript — and it detects the language, compiles it to C, and loads the result. Rust bindings come out the same door.
rust
use equilibrium_ffi::load; let lib = load("examples/c-ffi/mathlib.c")?; lib.output_path.display() // ready to link
terminal
$ eq check $ eq install zig nim odin $ eq build --release $ eq generate abi.h --consumer scriptc
Pipeline
01 · DetectEleven languages mapped by extension. find_compiler() locates each toolchain on PATH — or eq install puts it there.
02 · Compile to CEvery source compiles to a C intermediate with the right flags — -fPIC and ReleaseFast for Zig objects, library archives for scriptc.
03 · BindThe C surface becomes Rust extern "C" declarations — or consumer wrappers in the very languages you started from.
LanguagesProducers compile to the C ABI. Consumers take any C header and generate in-process FFI declarations. scriptc does both directions.
VZigCC++C#RustDNimOdinHareTypeScript · scriptc
one header → every consumer
$ eq generate crepuscularity_abi.h --consumer rust # extern "C" block $ eq generate crepuscularity_abi.h --consumer zig # @cImport aliases $ eq generate crepuscularity_abi.h --consumer scriptc # bindings.ts + --ffi manifest
Ecosystem
rigtschk/rig
Cross-language native dependency manager. Detects the host language, adds crates from the CLI, and exposes them in-process through equilibrium-ffi — including TypeScript hosts via scriptc.
cargo install rigpkggithub.com/tschk/rig →
eqtstschk/eqts
One Rust API for TypeScript. Annotate with #[eqts::export] and run the same library in Node, Bun, Deno, and WebAssembly — records, results, async, streams, and object proxies included.
cargo install cargo-eqtsgithub.com/tschk/eqts →
eqswifttschk/eqswift
Two lines to FFI Rust into Swift. UniFFI proc-macros plus cargo eqswift emit Swift bindings from annotated Rust — no UDL files, no build.rs.
eqswift = "0.1" + uniffigithub.com/tschk/eqswift →
equilibrium · MIT · built with crepuscularity + moonshine