Go port of shaq — lock-free, shared-memory FIFO queues for IPC. Supports SPSC and MPMC modes.
go get github.com/tanmay4l/shaq-go
Binary-compatible with the Rust shaq crate. A Go process can read from a queue created by a Rust process (and vice versa) through the same shared-memory file.
cd interop && ./test.shThis runs a Rust writer that creates SPSC and MPMC queues, then a Go reader that verifies every item matches — proving identical memory layout across both implementations.
Go 1.25 vs Rust 1.93 (release):
| Benchmark | Go | Rust |
|---|---|---|
| SPSC SingleItem | 7.31 ns/op | 62.42 ns/op |
| SPSC Batch (1024) | 3.40 ns/op | 0.21 ns/op |
| SPSC LargeItem 512B | 19,072 MB/s | 8,387 MB/s |
| MPMC SingleItem (1P/1C) | 72.37 ns/op | 45.70 ns/op |
| MPMC Batch 1024 | 0.35 ns/op | 0.24 ns/op |
| MPMC MultiProducer (4P/4C) | 15,496 ns/op | 239 ns/op |
| MPMC LargeItem 512B | 6,759 MB/s | 9,273 MB/s |
go test -bench=. -benchtime=3s ./spsc/ ./mpmc/