Foreign Function Interface
The foreign function interface (FFI) lets Rux call functions defined outside the language — typically in C / C++ libraries — and exchange data with them. Each part of the FFI has a dedicated chapter:
| Topic | Description |
|---|---|
extern Declarations | Declaring functions defined outside Rux |
| Linking Libraries | Binding declarations to a native library with #Link |
Pointers are central to passing memory across the boundary — see Pointers and extern.
See Also
- Pointers and
extern— exchanging memory with native code #Link— the attribute that names the library- Conditional Compilation — platform-specific
externdeclarations
Fatal Errors
A fatal error aborts the program on an unrecoverable condition rather than returning an error to the caller. Fatal errors are reserved for bugs and invariant violations — situations the program is not expected to handle at runtime.
Extern Declarations
The extern keyword declares functions that are defined outside Rux — typically in C / C++ libraries.