ffi-bindings - Create FFI bindings between Lean 4 and C
Create Foreign Function Interface bindings between Lean 4 and C for native libraries and system APIs
Tags
Updated: 2026-03-10Capabilities
Typical Inputs
Typical Outputs
What this skill does
- define opaque types
- declare extern functions
- implement C functions
- register external classes
- compile with clang
- handle C memory
- marshal C types
- return tuples
- work with floats
- work with arrays
- handle optional values
- handle IO errors
Inputs
- C source files
- build configuration
- native library headers
- Lean 4 project
Outputs
- compiled shared library
- Lean external objects
- FFI bindings module
Requirements
- Lean 4
- C compiler
- lean library headers
