Zinc is an open-source project. Contributions are welcome at every level: bug reports, documentation improvements, new language adapters, and platform backends.Documentation Index
Fetch the complete documentation index at: https://mine-27913f41.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Repository structure
Building the core
core/target/release/libzinc_core.{so,dylib} and generates include/zinc.h.
Running tests
Linting
unwrap() calls are allowed in core library code. The CI build enforces this. Use ? for error propagation and .expect("reason") for infallible operations with a documented justification.
Adding a new language adapter
Every adapter follows the same pattern:- Load
libzinc_core.{so,dylib}via the language’s FFI mechanism. - Read
include/zinc.h(or replicate the function signatures) to define FFI bindings. - Wrap the C functions in a language-native
SharedRegionclass or module. - Provide
create,open, data access,notify,wait, andclosemethods. - Implement zero-copy data access (return a native buffer/view/slice backed by the mmap).
adapters/<language>/. Each adapter should have:
- A build file (
Cargo.toml,pyproject.toml,go.mod,package.json, etc.) - A README with installation and usage instructions
- A test file that exercises the full API surface against a running core library
- Build the core library (
cargo build --release). - Load the adapter and call
createwith a test name and capacity. - Write a known pattern to the data area.
- Call
openin a separate process or thread. - Verify the data is identical (no corruption, no copy).
- Test notify/wait roundtrip.
- Close both handles and verify the region is unlinked.
Adding a platform backend
Platform backends live incore/src/platform/. Each backend implements three functions:
map(name, mode) -> MappedFile— creates or opens a shared memory segment and maps it.unmap(file) -> Result<()>— unmaps the segment.unlink(name) -> Result<()>— removes the segment name from the system.
sync.rs module handles notify/wait and is platform-specific. The Linux backend uses futex. Other platforms should implement the same semantics: an atomic increment for notify and a blocking wait for wait.
Code review
All changes go through pull requests. The review focuses on:- Correctness of the ownership model (does the new code handle create/open/close/unlink correctly?)
- Platform portability (does the new code compile on Linux and macOS?)
- Performance (does the hot path avoid allocation and system calls?)
- Error handling (are all error paths covered, and do they map to appropriate
ZincErrorvalues?)
Release process
Releases follow semantic versioning with a single version across all packages. The release checklist:- Update version numbers in
core/Cargo.tomland all adapter package files. - Run the full test suite on Linux and macOS.
- Build the core in release mode for all platforms.
- Run the integration test suite (all adapters against the release build).
- Tag the release (
git tag v<major>.<minor>.<patch>). - Publish adapter packages to their respective registries.
