Prutal
March 20, 2026 ยท View on GitHub
Prutal is a pure Go alternative to protocol buffers, it covers most of the functionality offered by Protocol Buffers.
Prutal aims to minimize code generation as much as possible while ensuring serialization and maintaining good performance.
Since Prutal is NOT yet ready for production use, we are not providing usage documentation at this time, nor do we guarantee backward compatibility of the interface.
Feature Comparison
| Features | Prutal | Protobuf |
|---|---|---|
| Supported Languages | Go | C++, Java, Python, Go, and more |
| Code Generation | โ | โ |
| Generated Code Size | ๐ compact | ๐ก bulky |
| Serialization | โ | โ |
| Performance | โญ๏ธโญ๏ธโญ๏ธโญ๏ธโญ๏ธ | โญ๏ธโญ๏ธโญ๏ธ |
| Extensibility | ๐ Package | ๐ก Plugin |
| Compatibility | โ (see Protobuf Compatibility) | โ |
| gRPC | โ | โ |
| Non-Pointer Field | โ (aka gogoproto.nullable) | โ |
Protobuf Compatibility
- โ Works with code generated by the official Protocol Buffer Go
Core Message Operations
- โ Marshal / Unmarshal โ binary wire format
- โ MarshalAppend โ append-friendly encoding
- โ Size โ compute wire size without marshaling (zero allocation)
- โ Reset
- โ Clone / Merge / Equal
- โ CheckInitialized โ validate required field presence
- โ MarshalOptions / UnmarshalOptions (deterministic output, discard unknown, recursion limits, etc.)
Proto Language Support
- โ Scalar types: all 15 protobuf scalar types
- โ Messages and nested messages
- โ Repeated fields
- โ
Enums (including
allow_alias) - โ Optional / field presence
- โ Map fields
- โ Oneof fields
- โ Required fields (proto2)
- โ
Packed / unpacked encoding
- PACKED / EXPANDED (repeated field encoding, edition 2023)
- โ Unknown field preservation
- โ Reserved fields and names
- โ Default scalar values (proto2, edition 2023)
- โ Groups (proto2, deprecated)
- โ UTF-8 validation
- โ Message sets (legacy format)
Encoding Formats
- โ Binary wire format
- โ ๏ธ JSON: struct tag only, no
protojsonequivalent - โ Text format (
prototext) - โ Delimited format (length-prefixed message streams)
Reflection
- โ Descriptor-based reflection (
protoreflect) - โ Type registries (
protoregistry) - โ Dynamic messages (
dynamicpb)
Extension Support
- โ ๏ธ Extensions (proto2): parsed but limited codegen
- โ Has / Get / Set / Clear / Range extensions
Code Generation (prutalgen)
- โ Proto2, proto3, edition 2023
- โ Imports (regular, public, weak)
- โ gRPC / Services (client/server stubs, streaming)
- โ ๏ธ Go only
- โ ๏ธ Well-known types: reuses
google.golang.org/protobuf/types/known,Anyis limited - โ ๏ธ Custom options: subset of gogoproto options
- โ Edition 2024
- โ Opaque API / lazy decoding
- โ Deprecation markers
How to use Prutal with gRPC
Use pkg/grpccodec and pass grpccodec.PrutalCodec to the gRPC v1 codec APIs on both server and client.
See pkg/grpccodec/README.md for usage details and tests/cases/grpc for a complete example.
Contributing
Contributor guide: Contributing.
License
Prutal is licensed under the terms of the Apache license 2.0. See LICENSE for more information.
Dependencies used by prutal are listed under licenses.