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.kiProduces .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.kiThe 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:
- Write a Kira library with
pubfunctions - Build with
kira build --lib mylib.ki - Include the generated
.klextern block in your Klar project - Link against the compiled
.ofile
See Building Libraries for the complete workflow.
Type Mapping
| Kira | C | Klar |
|---|---|---|
i32 | int32_t | i32 |
i64 | int64_t | i64 |
f64 | double | f64 |
bool | bool | Bool |
string | const char* | CStr |
void | void | Void |