protocolbuffers / protocolbuffers/protobuf
Delimited Messages - let's harmonize across languages
@fowles is already working on this.
Since Jul 18, 2022.
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
What language does this apply to?
If it's a proto syntax change, is it for proto2 or proto3?
No syntax change.
If it's about generated code change, what programming language?
All Languages
Describe the problem you are trying to solve.
Delimited messages is so core to serializing repetitive payloads to file and network streams that it seems this should be classed as a core use case.
Describe the solution you'd like
Coming into the parsing of delimited messages fresh and pulling my hair out, I missed the details that function for C++ was contained in delimited_message_util.h. However, the solution presented by Kenton in https://github.com/protocolbuffers/protobuf/pull/710 is IMHO much better and more obvious.
Please harmonize this small but critical delimited function with codegen, and let's get this key function mainlined across; Python, Java, C++, and C#. I'm using this length delimited reading/writing on three of the four languages here, and it's telling of how valuable the cross-platform nature of protocol buffers is with delimited messages.
Describe alternatives you've considered
It's varied, but stuffing the delimited reading/writing into C++ utils is confusing. It's missing from Python so always rolling own, but length delimited function is present in Java and C#. They all share uint32 length with specific byte ordering style.
Additional context
Add any other context or screenshots about the feature request here.
Not at this time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.