5.5. Adding FFI Bindings
To expose a new Lean function via FFI:
-
Add
@[export l4yaml_function_name]to the Lean definition -
Declare the corresponding C prototype in
ffi/l4yaml.h -
Add any necessary shim code in
ffi/l4yaml_shim.c -
Update the Python/Rust wrappers as needed
-
Add tests at each layer
The @[export] attribute instructs the Lean compiler to generate
a C-callable symbol with the specified name.