views:

355

answers:

1

why not a lua implementation of google's protocol buffers? is there already any better solution exist for lua?

+2  A: 

Probably because a C or C++ implementation would be faster (and easier to write), and then you could hand the data off to Lua to be used if you want.

There's a 100 line C protocol buffer parser here: http://blog.reverberate.org/2008/07/12/100-lines-of-c-that-can-parse-any-protocol-buffer/

Or you could just use the Google C++ one, and then hand your data off to Lua from there.

Lua isn't built for bit twiddling, so perhaps that's why nobody has implemented protocol buffers in it yet. It doesn't even have bitwise operators built in: http://lua-users.org/wiki/BitwiseOperators

pib

related questions