Hi all, I got a wild idea... The well know types is used a lot but they are 
cumbersome to write.As a contract first DSL this is not really readable. 
What if we could get rid of the complete package. It could be as simple as 
replacing the package of WKT by !

Example for wrappers:

message ProtoBeamBasicNullablePrimitive {
    google.protobuf.StringValue nullable_string = 1;
    google.protobuf.DoubleValue nullable_double = 2;
    google.protobuf.FloatValue nullable_float = 3;
    google.protobuf.Int32Value nullable_int32 = 4;
    google.protobuf.Int64Value nullable_int64 = 5;
    google.protobuf.UInt32Value nullable_uint32 = 6;
    google.protobuf.UInt64Value nullable_uint64 = 7;
    google.protobuf.BoolValue nullable_bool = 8;
    google.protobuf.BytesValue nullable_bytes = 9;
}


into

message ProtoBeamBasicNullablePrimitive {
    !StringValue nullable_string = 1;
    !DoubleValue nullable_double = 2;

    !FloatValue nullable_float = 3;

    !Int32Value nullable_int32 = 4;

    !Int64Value nullable_int64 = 5;

    !UInt32Value nullable_uint32 = 6;

    !UInt64Value nullable_uint64 = 7;

    !BoolValue nullable_bool = 8;

    !BytesValue nullable_bytes = 9;

}


Example for Duration and Timestamp:

message ProtoBeamWktMessage {
    string test_name = 1;
    int32 test_index = 2;
    google.protobuf.Timestamp timestamp = 3;

    google.protobuf.Duration duration = 4;

}


into

message ProtoBeamWktMessage {
    string test_name = 1;
    int32 test_index = 2;
    !Timestamp timestamp = 3;

    !Duration timestamp = 4;

}


Maybe it could be generalised, where the ! acts like a static import on the 
import

import !"google/protobuf/timestamp.proto";


this way if you add ! to the import, you can use the ! on all types in the 
imported Message types ( example !Timestamp ).

I think this could all be done in a compatible way. It does give the protoc 
compiler some extra work, but the resulting descriptor would be the same, 
referencing the full path.

Ok, I know... crazy idea ;-)

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to