5 ms·
BSON and Data Interchange
- tylerneylon 15y agoSee also bert-rpc, which is a cross-language/platform serialization standard along with fast rpc support. This is what github uses: http://bert-rpc.org/ http://bert-rpc.org/
- clarkevans 15y agoIt'd be nice if the Python version of BSON were pulled out and put in a separate module so that it could be used independent of MongoDB.
- seanalltogether 15y agoMaybe I'm wrong, but it seems like the only thing missing from json is a standard for dealing with time, and a standard for dealing with typed objects/arrays. Wrap all that into a binary format and call it done. All these other additions seem like bloat to me designed for some specific language or use case.
- jvoorhis 15y agoWhen are UNIX time or ISO-8601 insufficient?
- billpg 15y ago"dtSomeTimestamp": "2011-08-24T18:02:00.000Z" Is that a date and time, or a string that just happens to look like a date and time? JSON doesn't know the answer, so a convention outside of JSON will need to decide.
- skrebbel 15y agoBecause every programming language's library does it slightly different. With the T, without the T, with or without the Z, converted to UTC or not.. Of course it's no rocket science to figure out, but it's work every time. Notably, JavaScript has no standard way to convert a Date to e.g. 2007-03-01T13:00:00Z. UNIX timestamps are worse because there's no hint about the timezone (should be UTC but often isn't), plus no space for milliseconds. Of course you can just *1000 for msecs and document that it's UTC, but once again, not trivial. Basically, you can't just convert a JSON string date into your language's Date(Time) class and be sure that it went right. This is a lot of energy wasted.
- skrebbel 15y agoA lot of tools for (almost) the same job, it seems. I also like Zed Shaw's TNetstrings alternative: http://tnetstrings.org/ http://tnetstrings.org/ I like how it, indeed, is trivial to parse.