RProtoBuf had a funny start. I had blogged about the 12 hour passage from proof of concept to R-Forge project following the ORD session hackfest in October. What happened next was as good. Romain emailed within hours of the blog post and reminded me of a similar project that is part of Saptarshi Guha's RHIPE R/Hadoop implementation. So the three of us--Romain, Saptarshi and I---started emailing and before long it becomes clear that Romain is both rather intrigued by this (whereas Saptarshi has slightly different needs for the inner workings of his Hadoop bindings) and was able to devote some time to it. So the code kept growing and growing at a fairly rapid clip. Til that stopped as we switched to working feverishly on Rcpp to both support the needs of this project, and to implement ideas we had while working on this. That now lead to the point where Rcpp is maturing in terms of features, so we will probably have time come back to more work on RProtoBuf to take advantage of the nice templated autoconversions we now have in Rcpp. Oddly enough, the initial blog post seemed to anticipate changes in Rcpp.
Anyway -- RProtoBuf
is finally here and it already does a fair amount of magic based of code reflection
proto files. The Google documentation has a simple
example of a 'person' entry in an 'addressbook' which, when translated to R,
goes like this:
R> library( RProtoBuf ) ## load the package R> readProtoFiles( "addressbook.proto" ) ## acquire protobuf information R> bob <- new( tutorial.Person, ## create new object + email = "firstname.lastname@example.org", + name = "Bob", + id = 123 ) R> writeLines( bob$toString() ) ## serialize to stdout name: "Bob" id: 123 email: "email@example.com" R> bob$email ## access and/or override  "firstname.lastname@example.org" R> bob$id <- 5 R> bob$id  5 R> serialize( bob, "person.pb" ) ## serialize to compact binary format
More changes should be forthcoming as Romain and I find time to code them up. Feedback is as always welcome.