--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Feng Xiao,I have some questions:1. does protobuf3 will include golang compiler?
2. does protobuf3 have a spec doc (link?) ?
Really awesome!One question about maps — how are they encoded in terms of packed size? How does it compare to just using a repeated message with key/value pairs?
--
Hallo Feng,
> Am 11.12.2014 um 05:51 schrieb Feng Xiao <xiao...@google.com>:
>
> Hi all,
>
> I just published protobuf v3.0.0-alpha-1 on our github site:
> https://github.com/google/protobuf/releases/tag/v3.0.0-alpha-1
a question on structuring web applications further downstream:
you mention node.js and JSON (de)serialisation
reading between the lines this would suggest to me a typical protobuf application talking to a web client would talk JSON-serialized protobuf (maybe over a websocket stream)
I've used this scheme and while JSON is easy for browser js engines, there are downsides; for instance, (de)serializing doubles from/to JSON usually creates conversion/rounding fuzz - that precludes signing a protobuf object in binary representation because the signature generally wont be valid after JSON conversion. Looser type checking is another drawback.
That is why I found an end-to-end binary protobuf transfer and client-side js bindings along the lines of https://github.com/dcodeIO/ProtoBuf.js more robust
what's the grand vision here - how are web apps going to talk to protobuf API's server-side?
Does the arena allocator also get used by messages allocated as children of the root message?
As far I know, protobuf wire format does not have much of an advantage over JSON format on web apps because the payload is usually small enough and encoding/decoding protobuf wire format with Javascript does not necessarily have a better performance than the built-in JSON encoder/decoder.
Does Arena allocator support custom memory pool override ? Can NUMA aware memory pools be used instead ?
Any change to the set_allocated ?
--
Would it be possible to re-introduce this feature in a subsequent release? It seems like you are still using it under-the-hood.
And because of the benefits I mentioned above, I strongly feel that it will only help the community.
Feng,What do you mean when you say "In C++/Java/Python where we support both proto2 and proto3, default values will continue to exist"?
Since this feature is never going to be exposed, what advice do you have for people who are using this feature and want to migrate to v3? Also, what can we do as users to skip encoding certain fields with the new library?
I fully second that opinion. We rely a lot on being able to set explicit defaults that are not language defaults (Java 0, "", false, etc). It puzzles me to even think as to why someone might want to take that feature away!!!
On Wednesday, January 14, 2015 at 6:50:37 AM UTC-6, Jeremy Swigart wrote:That sounds like a poor design decision, and one easily readded without breaking anything. If a field doesn't have an explicit default, you use 0 or whatever, thereby not breaking anyone not using them, but if an explicit default is provided that is used instead. I am using that feature as well.
--
--
You received this message because you are subscribed to a topic in the Google Groups "Protocol Buffers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/protobuf/ZRpcfmeGK6s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to protobuf+u...@googlegroups.com.
--
Feng,
Would it not be better to throw errors/exceptions when you try to serialize to JSON (from languages like C++ or Java) or when code is generated for these particular languages, rather than completely remove the feature across the board?
Hi all,I just published protobuf v3.0.0-alpha-1 on our github site:This is the first alpha release of protobuf v3.0.0. In protobuf v3.0.0, we will add a new protobuf language version (aka proto3) and support a wider range of programming languages (to name a few: ruby, php, node.js, objective-c). This alpha version contains C++ and Java implementation with partial proto3 support (see below for details). In future releases we will add support for more programming languages and implement the full proto3 feature set. Besides proto3, this alpha version also includes two other new features: map fields and arena allocation. They are implemented for both proto3 and the old protobuf language version (aka proto2).We are currently working on the documentation of these new features and when it's ready it will be updated to our protobuf developer guide. For the time being if you have any questions regarding proto3 or other new features, please post your question in the discussion group.CHANGS=======
Version 3.0.0-alpha-1 (C++/Java):General* Introduced Protocol Buffers language version 3 (aka proto3).When protobuf was initially opensourced it implemented Protocol Bufferslanguage version 2 (aka proto2), which is why the version numberstarted from v2.0.0. From v3.0.0, a new language version (proto3) isintroduced while the old version (proto2) will continue to be supported.The main intent of introducing proto3 is to clean up protobuf beforepushing the language as the foundation of Google's new API platform.In proto3, the language is simplified, both for ease of use and tomake it available in a wider range of programming languages. At thesame time a few features are added to better support common idiomsfound in APIs.The following are the main new features in language version 3:
1. Removal of field presence logic for primitive value fields, removalof required fields, and removal of default values. This makes proto3significantly easier to implement with open struct representations,as in languages like Android Java, Objective C, or Go.
=======Thanks,Feng
As a new user, we still have need (C++ target) for default values, as well as required fields (e.g., message headers for embedded target).
1) It appears that you are completely removing the default/required capability from the proto3 language. Is this correct ?
2) Will the proto2 language be maintained going forward ?
Hi all,I just published protobuf v3.0.0-alpha-1 on our github site:This is the first alpha release of protobuf v3.0.0. In protobuf v3.0.0, we will add a new protobuf language version (aka proto3) and support a wider range of programming languages (to name a few: ruby, php, node.js, objective-c). This alpha version contains C++ and Java implementation with partial proto3 support (see below for details). In future releases we will add support for more programming languages and implement the full proto3 feature set. Besides proto3, this alpha version also includes two other new features: map fields and arena allocation. They are implemented for both proto3 and the old protobuf language version (aka proto2).We are currently working on the documentation of these new features and when it's ready it will be updated to our protobuf developer guide. For the time being if you have any questions regarding proto3 or other new features, please post your question in the discussion group.CHANGS=======
Version 3.0.0-alpha-1 (C++/Java):General* Introduced Protocol Buffers language version 3 (aka proto3).When protobuf was initially opensourced it implemented Protocol Bufferslanguage version 2 (aka proto2), which is why the version numberstarted from v2.0.0. From v3.0.0, a new language version (proto3) isintroduced while the old version (proto2) will continue to be supported.The main intent of introducing proto3 is to clean up protobuf beforepushing the language as the foundation of Google's new API platform.In proto3, the language is simplified, both for ease of use and tomake it available in a wider range of programming languages. At thesame time a few features are added to better support common idiomsfound in APIs.The following are the main new features in language version 3:
1. Removal of field presence logic for primitive value fields, removalof required fields, and removal of default values. This makes proto3significantly easier to implement with open struct representations,as in languages like Android Java, Objective C, or Go.
=======Thanks,Feng
As a new user it's encouraged to begin implementation with PB3.0+ opposed to 2.6. With that being said, since I'm beginning integration now and replacing XStream with this, where would you suggest I start? There is very little / no documentation available at this time, and there hasn't been an update since.
Specifically I'm curious how to go about tackling serialization of objects that inherit properties and methods from a parent class. IIRC, this was handled with extensions and .setExtension() in older version, however I was unable to figure out how to use the new 'any' type and the compiler threw errors when attempting to work with it blindly.
--
Will the extensions in the descriptor.proto also be changed to Any types?
--
Feng,Version 3 removes presence logic.How do we exam whether a field is exist or not?
--
I don't understand. If a message is a simple struct then the generated wrapper code would populate it with the default as defined by the proto it was compiled with wouldn't it? Are you suggesting that the implementation on different platforms would lack the wrapper objects generated by protobuf?
As long as you have that you have the default value. This rationale doesn't make sense.
message manyMsg{ // workaround: wrap the repeating message
repeated oneMsg = 1;
}
message unionMsg{
oneof testOneof{
manyMsg msg = 1; // doesn't allow repeated
uint32 foo = 2;
}
}
Hi,
Thanks for all your work with protobuf. I am excited about the changes with proto3 that will reduce errors (no forgetting to set has_* in nanopb, yay!) and will make mapping into new languages much simpler, helping our interop case a lot.
My question is: We are currently using protobuf pretty extensively and it looks like we will not be impacted by any changes in proto3 in our proto files (all fields being present, removal of required, default values, etc.) Does this mean our existing proto2 applications are compatible on-the-wire with proto3?
How upwards-compatible is proto3 with proto2?
Of course I will test this as well but I was wondering if there are any planned breakages of the wire format or if they will be compatibly phased in.
3. Removal of extensions, which are instead replaced by a new standard type called Any.
import "google/protobuf/descriptor.proto"; extend google.protobuf.MessageOptions { optional string my_option = 51234; } message MyMessage { option (my_option) = "Hello world!"; }
2. Removal of unknown fields.
3. Removal of extensions, which are instead replaced by a new standardtype called Any.
=======Thanks,Feng
When arenas are used, do they capture all dynamic allocation, or is there other memory allocated at some time? For example, is there any static initialization done by protobufs? What about when you modify a parsed proto by using e.g. clear_data()/add_data()/clear()/append()? Etc.
--
I am also evaluating proto2 vs proto3 and even though it seems proto3 should be the way to go I really miss the has_** functionality in proto3.
It seems the following proto pattern may be a workaround:
message M{
oneof optional_value{
int32 value = 1;
}
}
It does generate value(), set_value(), clear_value() and has_value() methods (C++) but unfortunately the has_value is private.
Is there a reason such a useful and short method is declared private (it implementation only uses public functionality as well)
has_...()
methods go away except for message fields. For oneofs, the idiomatic API pattern is to use get_oneof_case()
to check which field in the oneof is set."--
You received this message because you are subscribed to a topic in the Google Groups "Protocol Buffers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/protobuf/ZRpcfmeGK6s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to protobuf+u...@googlegroups.com.
but are just a hassle to write/update and use....I now have to redefine all such method for my needs and they have exactly the same definitions as the private members,But it is also convenient for other uses, so hiding it is superficial.It is still defined because it is convenient for the "internal" code.but for oneof has_... makes perfect sense.I understand it was an intentional design decision, I just fail to understand the reasoning for it.
I see this statement.
>>"In proto3, this is an intentional design decision:has_...()
methods go away except for message fields. For oneofs, the idiomatic API pattern is to useget_oneof_case()
to check which field in the oneof is set."
It is obvious for me that regular non-message fields should not have has_.. in proto3.
First of all, thanks for the great work; I've been using protobufs for a while, and it's good to see them evolving.One question - if map field is internally emulated by repeated field type, is it packed (e.g. [packed=true]) by default, and is there a way to pack it?
As a related question, was there a thought about making repeated fields packed by default, now that .proto language is changing in backward-incompatible manner?
Hi FengWhat would you say is a reasonable ETA for the protobuf 3 full release? Are you going through a series of RC's first?
--
Hi FengWhat would you say is a reasonable ETA for the protobuf 3 full release? Are you going through a series of RC's first?We will have a series of alpha releases followed by a series of betas. The 3 full release may be in Q4 this year.
Thank you!James
Will the C# implementation support proto2 message as well?What is the compatibility story between proto2 and proto 3? I assume the wire format is compatible as long as no proto 3 exclusive features are used.
--
You received this message because you are subscribed to a topic in the Google Groups "Protocol Buffers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/protobuf/ZRpcfmeGK6s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to protobuf+u...@googlegroups.com.
In other words C# and those new languages won't be able to serialize the descriptor?
Is there a plan to also arena allocate string fields?
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
On Tue Jan 13 2015 at 3:17:26 PM Arjun Satish <arjun....@gmail.com> wrote:Since this feature is never going to be exposed, what advice do you have for people who are using this feature and want to migrate to v3? Also, what can we do as users to skip encoding certain fields with the new library?We are aware of the migration difficulties from v2 to v3 due to removed features. As such we do not encourage existing users to migrate and commit to continue the support for proto2 syntax.You could have both proto2 and proto3 syntax files in your project and they are allowed to import each other despite the syntax differences.Thanks,On Tue, Jan 13, 2015 at 3:10 PM, Feng Xiao <xiao...@google.com> wrote:On Tue, Jan 13, 2015 at 3:05 PM, Arjun Satish <arjun....@gmail.com> wrote:Feng,What do you mean when you say "In C++/Java/Python where we support both proto2 and proto3, default values will continue to exist"?What I meant is that you can still find its traces in the implementation but the feature itself is not exposed publicly in proto3 (i.e., we are still using it under-the-hood).When I run protoc (v3) with the syntax="proto3" tag, it shows an error "Explicit default values are not allowed in proto3." and exits (no code is generated). This does not let me use other proto 3 features if my proto definition file contain default values.Thanks for your timely responses! Highly appreciate it!On Tue, Jan 13, 2015 at 10:35 AM, Feng Xiao <xiao...@google.com> wrote:On Mon, Jan 12, 2015 at 10:40 PM, Arjun Satish <arjun....@gmail.com> wrote:Would it be possible to re-introduce this feature in a subsequent release? It seems like you are still using it under-the-hood.In C++/Java/Python where we support both proto2 and proto3, default values will continue to exist. In new languages (e.g., ruby) though, the support for non-zero default values will be dropped completely.And because of the benefits I mentioned above, I strongly feel that it will only help the community.As far as I know, the decision is final. Internally a lot Google projects have already adopted the new syntax and so far we have not heard problems caused by disallowing default values. It's unlikely this will be changed in the future. The omission of this feature (and other features) is to make the language simpler and to allow more idiomatic implementations in a wider range of languages. It's believed this decision will help the protobuf community (both protobuf maintainers and protobuf users) and we expect proto3 to be a version that can be more easily adopted than proto2 by new users due to these simplifications. For existing users who rely on removed features, they can continue to use proto2 and that will be supported for a long time (if not forever). Currently we generally do not recommend migrating existing proto2 projects to proto3 because of incompatibility issues (e.g., extensions are dropped in proto3) and only recommend new users to use proto3.
Best,On Wed, Jan 7, 2015 at 8:01 PM, Feng Xiao <xiao...@google.com> wrote:+liujisi, who should have a better idea of why default value is dropped from proto3 and what alternatives users can rely on.
Internally the design of proto3 has been discussed among a group of people for quite a long time, but most of them haven't subscribed this forum though...On Wed, Jan 7, 2015 at 18:52 Arjun Satish <arjun....@gmail.com> wrote:Did anyone get a chance to look at this request?
On Wednesday, December 17, 2014 3:54:12 PM UTC-8, Arjun Satish wrote:Hey guys,
Thanks for all the hard work!
I have a question regarding the decision to drop support for default values. Fields which are set to their default values are not serialized. I noticed that in the new code (3.0.0-alpha-1 for Java), this condition still holds true. But the default values used are the standard ones (0 for int64/int32 etc) and cannot be specified in the .proto file. In some of my code, I had reasons to use non-zero default values (-1 for some integers, 1024 for some others, 3.14 for some doubles etc). Using the old protocol buffers, this was trivial to implement. This was a great feature as we could save atleast 2 bytes for every "untouched" field (which comes in handy when we persist the data :-)).
Is there any way we can retain specification of default values in the .proto files and using them in the generated encoders/decoders?
Thanks very much!
Looking forward to the 3.0 release!
Best,
Arjun Satish
--