2 ms·
I'm not using JSON or MessagePack because I need to send arbitrary binary data. I understand why people use JSON, and it has its domain (sending data to and fro
by X-Istence 15y ago
I'm not using JSON or MessagePack because I need to send arbitrary binary data. I understand why people use JSON, and it has its domain (sending data to and from the browser), but in other situations I don't think it is a good protocol.
Another poster mentioned tnetstrings, those look interesting, however I am not sure how well those would handle binary data.
- andrewvc 15y agoMessagepack is built to handle arbitrary binary data efficiently
- simonw 15y agoI wouldn't say JSON's main domain is sending data to the browser - I'd say it's exchanging common data structures (lists, hashes, strings, numbers) between environments, including between different languages. Sure, it doesn't make sense if you're shipping binary blobs around, but most of the time you're probably dealing with lists, hashes, strings and numbers.
- barrkel 15y agoJSON is good for edge labeled trees. XML is good for node labeled trees. But the data structures we want to transport are most often edge labeled graphs. You usually end up having to invent a mechanism for canonical node references to turn the tree into a possibly cyclic graph and vice versa. ISTM to improve on JSON, focus should be here.