Re:Son: A minimal subset of JSON for machine-to-machine comm...
by zbentley on Sunday December 10, 2017 @11:40AM
(#15892144)
Does CBOR support lazy/partial deserialization? It's not a make-or-break feature, but the ability to pluck out individual fields from large MessagePack documents without deserializing the whole thing has been a significant performance/memory savings for me many times.
I haven't played with flatbuffers, but it probably supports this as well, given its design. Are there other binary protocols that have first-class (i.e. present with a good API in the client libraries for all major languages) support for lazy/partial deserialization?
Re:Son: A minimal subset of JSON for machine-to-machine comm...
by js8 on Sunday December 10, 2017 @02:13PM
(#15892949)
CBOR is very similar to MsgPack, so yes (if you design the schema well enough).
Re:Son: A minimal subset of JSON for machine-to-machine comm...
by RantyDave on Sunday December 10, 2017 @11:31PM
(#15895170)
More cbor ranting... In Python you can replace json.loads/dumps with cbor.loads/dumps with no further changes. Going back again may prove to be an issue when you discover just how much it is that json can't do.
Re:Son: A minimal subset of JSON for machine-to-machine comm...
by ci5er on Sunday December 10, 2017 @01:22PM
(#15892673)
Is/Can CBOR be canonicalized (like ASN.1, for example) for the purpose of unambiguous generation and interpretation of hashes?
EDIT: I am happy to see that it handles date-time. Not really my favorite part of the non-spec of JSON on that front...
Re:Son: A minimal subset of JSON for machine-to-machine comm...
by heavenlyhash on Saturday December 23, 2017 @02:25PM
(#15995771)
You might be interested in IPLD in particular: https://ipld.io/
They use CBOR as the underlying serialization, and have a deep interest in canonicalization and applications of hashing.
I say that a bit tongue in cheek, but really: BSON has a monstrous amount of basic data types, some of which make very little sense and are very difficult to round-trip through other formats; and MessagePack had crippling basic sanity issues with what-are-bytes-vs-strings in its early history and that's something you simply can't recover from without declaring game over and making a new spec.
CBOR has neither of these issues. It's almost completely isomorphic to json, plus supports byte arrays. It's very nice.