ANN: protocol-buffers (bootstrap works) version 0.1.0

Chris Kuklewicz haskell at
Thu Aug 14 06:10:41 EDT 2008

Announcing the Haskell version of protocol-buffers, version 0.1.0.  This is 
still pre-beta.

The darcs repository is at
There is an (untested) tarball at

The original google version of protocol buffers is at

After tinkering for a while, the Haskell protocol-buffers package is now able to 
bootstrap the descriptor.proto file from the google source.

The lexer & parser can handle the full unittest.proto from the google source. 
The Lexer.hs module is created from "Lexer.x" by the Alex program (I am using 
Alex version 2.2).

The basics for the wire protocol are there, but have not been tested and need a 
small high level API.

There is no actual program yet.  The closest thing to an entry point is the 
"Text.ProtocolBuffers.Bootstrap" module which shows how I generated the modules 
from descriptor.proto.

Notes on the current implementation:
   The messages become Haskell record data types with 1 constructor and an 
individual module for namespace management.
   The fields become Haskell record names,
      optional fields are wrapped in Maybe
      repeated fields are wrapped in Seq (from Data.Sequence)
   Enumerations become Haskell data types with an individual module for 
namespace management.
   The enum values become different Haskell constructors for the type (no arguments)
   Wire protocol implemented on top of binary Get and Put monads (to and from 
Lazy ByteString)
   Some reflection is possible (via type classes)

   Make the Lexer check that TYPE_STRING default values are valid UTF-8 (easy).
   The handling of default string/bytes in Gen.hs is not quite right and will 
need to be fixed (easy).
   The next things to add are full support for TYPE_GROUP and then support for 
extensions (easy and medium).
   Check that the Lexer properly handles /* block style */ comments.
   Test the wire protocol versus google's implementation.
   I have not even started looking at serivice/method/rpc support.

   Chris Kuklewicz

More information about the Libraries mailing list