Re: [capnproto] Generating field numbers automatically

2017-07-26 Thread 'Kenton Varda' via Cap'n Proto
Ah, yes, if you're just converting to JSON then the field numbers are irrelevant. Conceptually, I would be OK with a way to annotate a struct which is not allowed to be serialized in capnp format. When such a struct is constructed in a message, the message would be marked such that attempts to ser

Re: [capnproto] Generating field numbers automatically

2017-07-25 Thread 'Kenton Varda' via Cap'n Proto
Hi Branislav, Thanks for the feedback. This is a frequent request for protobuf and Cap'n Proto. Presumably the compiler would automatically number the fields in the order they appear. My concern is that in this mode, it is very easy to accidentally introduce backwards-incompatibility by insertin

[capnproto] Generating field numbers automatically

2017-07-25 Thread Branislav Katreniak
When prototyping capnproto structs, I feel a bit of burden to make the compiler happy to assign valid numbers to all fields. What about having and option to let the compiler generate the sequence numbers automatically if the field number is not assigned to any field? Flatbuffers IDL works this