Hacker News new | past | comments | ask | show | jobs | submit login
Libcbor – CBOR implementation for C and others (libcbor.org)
37 points by pjk on May 24, 2015 | hide | past | favorite | 5 comments



Duncan Coutts has been working on replacing the current fairly brain dead Data.Binary encoding for Haskell by using CBOR [1], which I believe is currently on the back burner (more important work to be done elsewhere). The results appear very promising and I'd love to see this announcement provide the impetus to keep the work going.

[1] http://code.haskell.org/~duncan/binary-experiment/binary.pdf


Please, someone let Duncan know that CBOR encoding is somewhat not as useful as it could be.

I twitted about that unusefulness here [1] and here [2].

In short, CBOR orders major types in such a way that if you use memcmp negative integers go as bigger values than positive integers. This breaks important invariant "memcmp ordering as value ordering" which is EXTREMELY useful. If you preserve that invariant then you can sort, index and navigate over compact opaque representation of values without their decoding, saving time and memory.

[1] https://twitter.com/sergueyz/status/603491963258740736

[2] https://twitter.com/sergueyz/status/603492486191947776


I found a previous discussion on CBOR fairly insightful from 572 days ago - https://news.ycombinator.com/item?id=6632576


I wrote some Python bindings[0] for fun some time ago. I never did get around to implementing the full spec. I never did get around to implementing the full spec, but I did enjoy parsing the tests directly from the RFC.

[0] https://github.com/michaelmior/pycbor


See http://cbor.io/ for details about RFC 7049 "Concise Binary Object Representation" (CBOR)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: