Hacker News new | ask | show | jobs
by X4 4568 days ago
You probably never heard about these, but these are the best for Binary protocols. If you know something else, or better please post.

BEEP: http://www.aspl.es/vortex/

BSON: http://bsonspec.org/ (Binary Json)

8 comments

CBOR [0] is a proposed standard that seems much more efficient than BSON - check out the appendix [1].

[0] http://tools.ietf.org/html/rfc7049

[1] http://tools.ietf.org/html/rfc7049#appendix-E.6

checking out the rfc. cool, thanks!
MessagePack: http://msgpack.org
My only complaint for msgpack early on was that they didn't differentiate binary from strings, and they didn't explicitly state the format for strings (like utf8) ... other than that, it's a pretty nice format, though I don't see it particularly better than those mentioned in the article, or bson and others mentioned in this discussion.
Far simpler yet readable, there is the tried and tested bencode [0], or tnetstrings [1]. There are a little less efficient than pure-binary (especially regarding integers) and have less features, but are easier to read and write, even for a human, in my opinion.

[0] http://en.wikipedia.org/wiki/Bencode [1] http://tnetstrings.org/

Ah BEEP. I had a grad school project to create a domain specific modeling language that allowed you to diagram the steps for communication and between to systems using BEEP. You'd define the order of messages and the content of the messages the DSML would generate C code that implemented an API to do the communication you'd modeled.

God how I hated grad school.

That sounds like an amazing experience you had. I can feel the pain! Had to write a custom compiler and backend and vm for it in school. And none of us had experience in C or Assembler. The compiler created a custom bytecode assembly that the VM had to run. Then another group made an FGPA and CPU that runs the code natively. Our prof's hobby was to write an OS for that board. But somehow we managed to do it. I still wow, when I look at the code. It makes me think.. how did I write that?
wow, I'm amazed by your responses. Kudos to HN & I wish all of you "Happy New Year and a Merry Christmas" (⌐■_■)-♉