From XML to JSON to CBOR

It is a good format.

  • TLV for fast parsing.
  • Tags are extendable, so you can specify “this integer is actually a timestamp”.
  • Can round-trip JSON directly.
  • Has canonical form for signing.
  • Supports chunked streaming, so you do not need a separate framing format.

I had to reverse engineer a gRPC interface recently and honestly, I just wish people used CBOR instead. I mean, it even has compressed integers (inside type byte or 8, 16, 32, 64 bits after) and doesn’t encode -1 as 10 bytes. The footprint is comparable, but the format is self-documenting. I just don’t get people.

Read more here: Source link