Skip to main content

A protoc plugin that generates Zig bindings over upb

Project description

protoc-gen-zig

A protoc plugin that generates Zig bindings for Protocol Buffers, backed by the upb C runtime. protoc-gen-zig is part of the upb-zig project. protoc-gen-zig is the only Zig Protobuf implementation that passes the Protobuf conformance tests.

Installation

Install the Protobuf compiler first.

pip install protoc-gen-zig

Usage

protoc --zig_out=./gen your_file.proto

This assumes protoc-gen-zig has been added to $PATH, otherwise provide the path to protoc-gen-zig.

protoc --plugin=protoc-gen-zig --zig_out=./gen your_file.proto

How it Works

The code generator is written in Python using Mako templates. It reads protoc's CodeGeneratorRequest and outputs Zig source files that wrap the upb C runtime. The actual encode/decode logic lives in upb, which is fully conformant * The generated Zig code is a thin typed facade over that runtime.

Full runtime library and Bazel integration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protoc_gen_zig-0.0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file protoc_gen_zig-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: protoc_gen_zig-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for protoc_gen_zig-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d79781a921da1acced4c6ca459b171c643405344a90139ec6fcf06f3e9c5953
MD5 acd2a4f6afe770c2db3a2c093f6966a1
BLAKE2b-256 5b6ca3f5bc0a6dca88e551675089dc3cef1a3219f33a0b3755de1646741e895c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page