Skip to content

Feature Request: Official Zig language support for FlatBuffers code generation #9052

@tylitianrui

Description

@tylitianrui

Summary

Please add official Zig language support to the flatc code generator.

Background

Zig 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, 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)
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions