noalloc: Tooling and libraries to enforce zero heap allocations in Golang
g0xA52A2A
81 points
70 comments
October 28, 2026
Related Discussions
Found 5 related stories in 40.0ms across 3,874 title embeddings via pgvector HNSW
- It's all about the allocator ibobev · 62 pts · November 15, 2026 · 52% similar
- The lost malloc() matt_d · 153 pts · November 04, 2026 · 48% similar
- Hey linker, can you spare a meg? luu · 31 pts · October 28, 2026 · 47% similar
- Show HN: LZ0 -An asymmetric LZ compressor with ultra minimal, 0-alloc decoder seb3773 · 28 pts · November 19, 2026 · 47% similar
- Probabilistic Data Structures in Go mfrw · 41 pts · November 14, 2026 · 47% similar
Discussion Highlights (6 comments)
zinodaur
I love it. Any thoughts on allowing (value type) Pointers into a Region?
andrewla
The end state of every garbage collected language is a suite of tools to prevent garbage collection at all costs. I think we can learn something here.
kvemkon
Go compiler has an advanced escaping analyzer. Wouldn't it be easier and better to add this noalloc-analyzer feature to golang directly?
eatonphil
Hey folks, this is my project. I really liked OxCaml's zero_alloc feature [0], something you don't get in Rust or Zig or Go*, and have been trying to get a handle on allocations in The Consensus's code search engine. It's an extremely early project but it's been helping me out a bunch already. Would love to hear your bug reports or requests if you try running it on your codebase. [0] https://theconsensus.dev/p/2026/06/27/the-feature-in-oxcaml-... * I think you can get this in Clang and maybe GCC with `__attribute__((nonallocating))` though.
gritzko
If you don't allocate, why do you even need Go or Rust? LLMs handle less elegant syntax just as well. I use a zero-malloc C dialect with slices and bounds-checking. Just recently I was sketching a smallish database in zero-malloc C. https://replicated.live/blog/db That was partly because most LSM data structures are read-only, so mmap was good enough and concurrent access was safe for the bulk of the data. The "hot zone" (memtable) then requires some intricate engineering, but that is the case either way. You can go quite far with zero-malloc C.
kristianp
Interesting difference between Go and Python, `c.counts[name] += n` can allocate if name isn't already present, whereas in Python you get a key error.