[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [ANN] lua-pb Lua Protocol Buffers
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Thu, 23 Jun 2011 05:44:38 -0700
Announcing lua-pb  a Lua implementation of Google's Protocol Buffers .
What are protocol buffers?
Protocol buffers are a flexible, efficient, automated mechanism for
serializing structured data â think XML, but smaller, faster, and simpler. You
define how you want your data to be structured once, then you can use special
generated source code to easily write and read your structured data to and
from a variety of data streams and using a variety of languages.
lua-pb uses LPeg for parsing .proto  definition files and dynamically
generates message objects from the message definition. The encoder/decoder
code uses modules 'struct'  & Lua BitOp .
One of the main features that separates lua-pb from the other two
implementations  of Protocol Buffers for Lua, is that it doesn't require
static compiling of message definitions to native code. lua-pb dynamically
compiles message definitions at runtime.
See the test_media.lua  script for an example on how to use lua-pb.
Also lua-pb is designed with a flexible backend so a specialized backend can
be created for LuaJIT to make encoding/decoding faster. I haven't benchmarked
the current backend, but it should be reasonably efficient.
Robert G. Jakabosky