Skip to main content
Kira

FFI & Interop

Kira can produce C-compatible libraries and interoperate with other languages.

--emit-header Flag

Generate only header files without full C codegen:

kira build --emit-header mylib.ki

Produces .h and .kl files — useful for tooling and AI agents that only need the interface description.

--manifest Flag

Generate only the JSON type manifest:

kira build --manifest mylib.ki

The manifest is a machine-readable JSON file describing all exported functions (names, parameter types, return types) and type declarations. Useful for tooling and AI agents.

Klar Interop

Kira and Klar can work together. The workflow:

  1. Write a Kira library with pub functions
  2. Build with kira build --lib mylib.ki
  3. Include the generated .kl extern block in your Klar project
  4. Link against the compiled .o file

See Building Libraries for the complete workflow.

Type Mapping

KiraCKlar
i32int32_ti32
i64int64_ti64
f64doublef64
boolboolBool
stringconst char*CStr
voidvoidVoid