Feature Request: Official Zig language support for FlatBuffers code generation
- Dominant language
- C++
- Stars
- 26.5k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Please add official Zig language support to the `flatc` code generator.
## Background
[Zig](https://ziglang.org/) is a systems programming language with growing adoption in the
native/embedded/performance-sensitive ecosystem. It compiles to native code, has no hidden
control flow, and interoperates directly with C ABI — making it a natural fit for FlatBuffers.
We are currently building [zarrow](https://github.com/tylitianrui/zarrow), a Zig
implementation of Apache Arrow that depends on FlatBuffers for its IPC wire format. Right now
we rely on a third-party wrapper ([flatbufferz](https://github.com/archaistvolts/flatbufferz))
to consume the generated code, because there is no official `flatc --zig` backend.
## What we are asking for
- A `--zig` backend in `flatc` that generates idiomatic Zig structs/unions for FlatBuffers
schemas.
- Generated code should target the current stable Zig release (0.15.x) and track breaking
language changes going forward.
## Why now
- Zig 0.14+ has a stable package manager (`build.zig.zon`), making it practical to distribute
a generated runtime as a dependency.
- Several projects (Arrow, TensorFlow Lite, game engines) already target Zig, creating demand
for first-class schema-based serialization support.
## References
- Zig language: https://ziglang.org/
- Existing community wrapper: https://github.com/archaistvolts/flatbufferz
- FlatBuffers language support tracking: https://google.github.io/flatbuffers/flatbuffers_support.html
Contributor guide
Assessment
This issue has not been assessed yet.