Interface DefinitionΒΆ
In yace, the FFI boundary of a C API is described by a C header in a subset of C99. The subset is what can be described equivalently in C, C++, Python, Rust and Zig: the types, the records and the functions that cross the boundary, and nothing that only makes sense in one of them.
The header is parsed into the IR, the intermediate representation, which the targets generate code from. Each target generates code that is idiomatic for its language, the C target included: the C header it generates is not the one you wrote, but the C API derived from it, and may use what C allows and the subset does not.
What is the same across all of them is the ABI: the layout of every record and the signature of every function. The IR records the layout as the compiler laid it out, and every target checks what it generates against it.
Background, the API, the ABI, and what yace does about each
The C Subset, the subset, and why
Callback lifetimes, how long a library may call a callback, and what the bindings do about it
Rules, the rules, as yace reports them
C Parser, parsing a header
Storage Format, the IR as stored
Entities, the IR as Python classes