Add C-ABI to provide an ABI stable interface and improve compatibility
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- C++
- Stars
- 106
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AcademySoftwareFoundation/openqmc
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 57/100
AcademySoftwareFoundation/openqmc#117 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
AcademySoftwareFoundation/openqmc#100 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 32/100
AcademySoftwareFoundation/openqmc#71 · 4 comments ·
All issues in AcademySoftwareFoundation/openqmc
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/tensorstore#306 ·
-
comp-formats
Difficulty 2/5 Half a day Newbie friendliness 64/100
ClickHouse/ClickHouse#131694 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ETSInitiative/PETSIRD#243 ·
Maintainers usually reply within 1 day
-
[BUG][Ascend][AscendC] Scalar FP8 arithmetic stored to UB emits ".data" on a float and fails deviceOpenascend bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day