OpenQMC is C++ header-only, so it can only be used directly from C++. Adding a stable C ABI would let any language with C FFI support use the samplers, including C, Zig, and Rust.
The C ABI should:
- Wrap all six sampler types with extern "C" linkable symbols
- Cover the full public API (cache management, construction, domain derivation, draw functions)
- Preserve value semantics, no heap allocation
- Be gated behind an OPENQMC_ENABLE_C_ABI CMake option
- Keep boilerplate low when adding new samplers
This depends on the C++17 migration and removal of OPENQMC_ENABLE_BINARY being done first (#86). Larger goal is to make OpenQMC available to more languages to encourage broader adoption.
OpenQMC is C++ header-only, so it can only be used directly from C++. Adding a stable C ABI would let any language with C FFI support use the samplers, including C, Zig, and Rust.
The C ABI should:
This depends on the C++17 migration and removal of OPENQMC_ENABLE_BINARY being done first (#86). Larger goal is to make OpenQMC available to more languages to encourage broader adoption.