← All projects

zinc

Cross-language shared memory in Rust. Processes map the same physical pages, so a value written in one language is read in another with no serialization and no copies.

Rust 62 stars ossl-dev/zinc

Why it exists

SharedArrayBuffer shares memory between worker threads inside one process. Nothing does that across processes or languages, so moving a large dataset usually means serializing it, pushing it through a socket, and rebuilding it on the far side. Zinc maps the same RAM pages into every process, so there is nothing left to transfer.

What it does

A Rust core compiles to a shared library and exposes eight C functions; each language adapter is a thin FFI wrapper over that same ABI rather than a reimplementation. Regions are reference-counted through a 64-byte header, only the creator may unlink a segment, and handles unmap themselves when dropped. Adapters cover Python, Go, Node, Bun, Deno, C++, Java, and C#. It builds on POSIX shared memory, so Linux and macOS only, with no Windows support.