4 ms·
MessagePack is self-describing (it contains tags like "next bytes are an integer"), but Protobuf uses external scheme.
by comonoid 2y ago
MessagePack is self-describing (it contains tags like "next bytes are an integer"), but Protobuf uses external scheme.
- jabwd 2y agoYou can decode protobuf in the same way, I've written several decoders in the past that don't rely on an external schema. There are some types you can't always decode with a 100% confidence, but then again JSON or something like it isn't strongly typed either.
- comonoid 2y agoIndeed.
- SigmundA 2y agoprotobuf doesn't have key names without the schema right? Wouldn't it just decode to 1,type,value 2,type,value without the schema no names? Human readable key names is a big part of what makes a self describing format useful but also contributes to bloat a format with an embedded schema in the header would help.
- jabwd 2y agoSorry I never ended up replying. You are correct, in protobuf you have field numbers ( and I have to admit what I commented has been a number of years ago by now my knowledge is crusty ). Usually when doing this type of work, as I was doing, is to reverse some protocol. It didn't make me hate the format though; many protocols I had reversed in the past were vastly more complicated to decode and understand without having field names. If you ever want to melt your brain get into RTMP decoding :3