Deterministic
ABI layouts are byte-for-byte reproducible so every backend sees the same structure.
Use this page when you need the model behind ABI YAML before you start debugging layout behavior or designing advanced dynamic types.
Deterministic
ABI layouts are byte-for-byte reproducible so every backend sees the same structure.
Zero-Copy Friendly
The format is designed so generated code can access buffers directly instead of copying data out first.
Cross-Language
The same ABI definition can drive C, Rust, TypeScript, and reflection tooling.
| Rule | What to keep in mind |
|---|---|
| Endianness | Multi-byte values are little-endian. |
| Primitive types | The core type system includes signed and unsigned integers, floating-point types, and char. |
| Struct layout | Packed structs have no padding. Aligned structs insert padding based on natural alignment. |
| Arrays | Arrays can be fixed-size or runtime-sized through field references. |
| Flexible Array Members | Once the first runtime-sized field appears, offsets for later fields become runtime-dependent. |
| Enums and unions | Variant layout and discriminator rules must still yield deterministic validation behavior. |
| Dynamic parameters | Runtime-sized fields, tags, and payload sizes are tracked explicitly so validators, reflection, and codegen can agree on the same layout math. |
At a high level, an ABI file contains:
The type system supports:
The ABI toolchain supports multiple import sources:
That flexibility is useful, but it changes the safe publishing workflow:
The important authoring rule is that remote files cannot depend on local filesystem paths. Use Authoring Guide for how to structure imports and Publishing and Iteration for the publish-safe workflow.
The hardest ABI cases are the ones with runtime-sized fields. Common examples:
name_len field followed by a byte array of that sizebox.firstThose layouts are valid, but they are also where mistakes tend to surface first. Prefer to validate them with:
analyze --print-ir as the fastest way to inspect what the toolchain thinks the layout really is.