A header-only C++20 library for Protocol Buffers serialization/deserialization using C++ types instead of .proto files.
Protocol Puffers (protopuf) is a header-only C++20 library that implements Protocol Buffers-compatible serialization and deserialization. It allows developers to define message schemas directly in C++ using templates, eliminating the need for .proto files and external code generation tools. The library focuses on compile-time optimizations to deliver high runtime performance while maintaining full compatibility with the standard Protocol Buffers wire format.
C++ developers working with Protocol Buffers who want a modern, type-safe, header-only alternative to traditional protobuf toolchains, especially those using C++20 and interested in template metaprogramming.
Developers choose protopuf for its seamless integration into C++ projects without code generation, its compile-time optimizations for better performance, and its full compatibility with existing Protocol Buffers ecosystems while leveraging modern C++20 features.
Protocol Puffers: A little, highly templated, and protobuf-compatible serialization/deserialization header-only library written in C++20
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates the need for .proto files and code generation by defining schemas directly in C++ using templates, as shown in the example where Student and Class are defined as C++ types.
Ensures serialized data is fully compatible with standard Protocol Buffers encoding, allowing mutual serialization and deserialization with existing protobuf messages, stated in the features.
Uses extensive compile-time operations to optimize runtime performance, emphasized in the library's philosophy and key features for high-performance applications.
Easy integration into C++ projects without separate compilation steps, making it convenient for build systems, as noted in the key features and supported via vcpkg and Conan.
Known issues with MSVC 16.8 and GCC 10.2 can cause compilation errors, requiring developers to use updated compilers or work around these bugs, as mentioned in the known issues section.
Heavy reliance on C++20 templates and non-type template parameters often leads to cryptic compilation errors and increased compile times, especially for large or nested schemas.
Focuses only on serialization and deserialization, missing Protocol Buffers' RPC capabilities like gRPC, which limits its use in full-stack microservices or networked applications.
Does not generate code for other languages, making it unsuitable for projects where .proto files are shared with teams using Python, Java, or Go, unlike traditional protobuf toolchains.