Rendered at 09:16:39 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
kstenerud 1 hours ago [-]
Schemas save you space, but then you lose the ability to understand the data without the schema. That's where JSON has always been handy despite its inefficiencies.
Of course you can get the same kind of thing in binary. I wrote a drop-in binary JSON replacement because it's easy to write a binary one that's twice as fast as simjson and yyjson. The important thing is to never give the drop-in replacement any extras that break roundtrip compatibility.
> Schemas save you space, but then you lose the ability to understand the data without the schema. That's where JSON has always been handy despite its inefficiencies.
Of course that’s orthogonal to using a text v binary representation, you can have a schema’d text format, and a self-describing binary format.
BSON, UBJSON, MessagePack and CBOR are binary but self-describing.
deepsun 4 hours ago [-]
Cool. And the next enlightening step would be to generate custom parser code from message schemas. So that when de-serializer reads a next field, it does not read what name and type it will be, it expects and fails if it's not. Safer and more compiler friendly.
MiroslavPokorny 3 hours ago [-]
Congratulations, your strings dont support Unicode and you just ignored probably more than 3/4 or more of the world's languages.
Of course you can get the same kind of thing in binary. I wrote a drop-in binary JSON replacement because it's easy to write a binary one that's twice as fast as simjson and yyjson. The important thing is to never give the drop-in replacement any extras that break roundtrip compatibility.
Was a fun little project to write, and quite useful for me: https://github.com/kstenerud/bonjson
Of course that’s orthogonal to using a text v binary representation, you can have a schema’d text format, and a self-describing binary format.
BSON, UBJSON, MessagePack and CBOR are binary but self-describing.