How Futhark and Øpir work together
masterFuthark consists of two components:
- Øpir (or
opir): A helper program compiled withlibclang. It uses Clang to parse C headers and produces a JSON output containing all definitions with Nim-friendly types. futharkmodule: Provides theimportcmacro. This macro reads the JSON output from Øpir and applies user-defined overrides (likerenameorretype) before generating the final Nim definitions.
Futhark and Øpir cache their results, so subsequent compilations are as fast as using pre-generated Nim files.