Because MessagePack doesn't work in MacRuby.
You're Using JSON, Why not MessagePack?
21–30 of 66 posts
Re: You're Using JSON, Why not MessagePack?
#22For the same reasons we are in the process of switching from Protocol Buffers back to JSON: * It does not support our languages. Is there a Ruby module with no C extension? A C# library? Lua? What about that really cool language coming out next week? What about C? * Even if it does, why have to deal with someone else's poor API design? JSON has a million parsers for everything, and if by chance you don't like any of…
This first part was already addressed in another comment, but ...
> A C# library? Lua? What about that really cool language coming out next week? What about C?
... yes.
> It's not human-readable. Enough said.
"Enough said" is glib, but it doesn't seem obvious to me. The computer is the one using the data the vast majority of the time, not a human. I'd rather optimize for that, improve the user experience and reduce parsing overhead, and use protobuf --decode for my own debugging.
> It's smaller that JSON, sure, but is it smaller than gzipped JSON?
Is GZIP'd JSON smaller than GZIP'd protobuf? What is the decoding time of a GZIP'd JSON file vs a non-GZIPd protobuf file?
Regardless, all of these reasons seem to be more about making your life mildly easier (or at least more closely matching your preferences), and less about optimizing for CPU and bandwidth utilization of the client interface.
We just switched to protobuf because it allowed us to provide the best user experience by decreasing both parse time and transmission cost, AND we can auto-generate the serialization code, including validating the messages for correctness.
If anything, I'd choose to move to an even more rigorous message specification format, as having the validation done for us automatically keeps our client-side code very simple compared to the data extraction and type validation we have to write manually with JSON.
Re: You're Using JSON, Why not MessagePack?
#23http://bsonspec.org/ is another such alternative.
Yes. The first thing I said when I saw this post was "How is this different than BSON?" Given that BSON is the basis of MongoDB's storage engine, I'm pretty confident in it and probably won't be moving over to MessagePack anytime soon.
Re: You're Using JSON, Why not MessagePack?
#24Re: You're Using JSON, Why not MessagePack?
#25Earlier quoted context omitted.
Yes. The first thing I said when I saw this post was "How is this different than BSON?" Given that BSON is the basis of MongoDB's storage engine, I'm pretty confident in it and probably won't be moving over to MessagePack anytime soon.
bson messages are often larger than their json counterpart. The benefit of bson isn't size, but rather ease (on the cpu) of serializing and deserializing.
Re: You're Using JSON, Why not MessagePack?
#26Re: You're Using JSON, Why not MessagePack?
#27Because JSON is around twice as fast to encode/decode in Node, which is where I really need the performance. MessagePack is just slow, complicated, and unnecessary.
Re: You're Using JSON, Why not MessagePack?
#28Re: You're Using JSON, Why not MessagePack?
#29Another poster mentioned tnetstrings, those look interesting, however I am not sure how well those would handle binary data.
Re: You're Using JSON, Why not MessagePack?
#30My stock “basic data type” set comes mainly from Ruby these days. I wince a little at the lack of interned-symbol type, but it's possible to live without that. But what of string encodings? In a recent piece of code which I wouldn't mind replacing with MessagePack, I prefix strings with fixnum IANA encoding numbers. I suppose that's too much to ask in this context, though… ? How do other people deal with this—just force everything to UTF-8?