[Haskell-cafe] Binary Parsing

Rick R rick.richardson at gmail.com
Wed Mar 11 20:19:53 EDT 2009


I have basic beginning to a parser for the BSON spec:
http://www.mongodb.org/display/DOCS/BSON
It is basically a binary compressed form of JSON.
The usage model should be general, but I intend to read this data over TCP.

Currently my system is quite inefficient, I convert leading bytes to Int
then switch based on that type that that Int represtents.

I was wondering if there is a tool set that exists for this purpose. For
instance, should I use Data.Binary and make my Binary instance of get and
put use the BSON protocol? Or is that not correct?
I also looked at Parsec.ByteString, but that seems to only have a file input
mechanism, and tcp buffers may be out of its scope. Are there any other
tools that I should look at?

I'm sure similar things have been done before. Can anyone point me to some
open, successful implementations that I could mimick?


-- 
We can't solve problems by using the same kind of thinking we used when we
created them.
   - A. Einstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090311/fa726dbb/attachment.htm


More information about the Haskell-Cafe mailing list