• Stars
    star
    288
  • Rank 142,731 (Top 3 %)
  • Language
    Lua
  • License
    MIT License
  • Created about 13 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lua Protocol Buffers

lua-pb

Lua Protocol Buffers.

Supports dynamic loading of Protocol Buffer message definition files .proto

Installing

$ sudo luarocks install "https://raw.github.com/Neopallium/lua-pb/master/lua-pb-scm-0.rockspec"

Design

Frontend .proto definition file parser:

  • pb/proto/scanner.lua -- LPeg lexer for .proto files.
  • pb/proto/util.lua -- some utility functions.
  • pb/proto/grammar.lua -- LPeg grammar for .proto files.
  • pb/proto/parser.lua -- LPeg based .proto -> AST tree parser.

There can be multiple Backend message definition compilers. An optimized backend for LuaJIT is planned.

Standard backend compiler

  • pb/standard.lua -- main compiler code.
  • pb/handlers.lua -- a helper object for managing registered encode/decode formats.
  • pb/standard/message.lua -- defines message interface.
  • pb/standard/repeated.lua -- defines repeated field interface.
  • pb/standard/pack.lua -- binary format encoding (Uses modules luabitops & struct)
  • pb/standard/unpack.lua -- binary format decoding (Uses modules luabitops & struct)
  • pb/standard/buffer.lua -- encoding buffer
  • pb/standard/unknown.lua -- object for hold unknown fields.
  • pb/standard/dump.lua -- message dumping code.

Finished

  • .proto definition parser
  • Message encoding/decoding
  • Dumping messages to text format.
  • Support for packing/unpacking unknown fields.

TODO

  • rename pb/handlers.lua to pb/formats.lua

Missing features:

  • custom options:

    import "google/protobuf/descriptor.proto";

    extend google.protobuf.MessageOptions { optional string my_option = 51234; }

    message MyMessage { option (my_option) = "Hello world!"; }

  • services

Improvements:

  • store unknown fields as raw binary, only fully decode when accessed.
  • LuaJIT optimized backend compiler.

More Repositories

1

lualogging

New maintainer at: https://github.com/lunarmodules/lualogging
Lua
146
star
2

llvm-lua

Automatically exported from code.google.com/p/llvm-lua
C
146
star
3

lua-llthreads

Low-Level threads(pthreads or WIN32 threads) for Lua.
C
143
star
4

bevy_water

Dynamic ocean material for Bevy.
Rust
116
star
5

lua-handlers

Provides a set of async. callback based handlers for working with raw TCP/UDP socket, ZeroMQ sockets, or HTTP client/server.
Lua
104
star
6

LuaNativeObjects

A Lua bindings generator written in Lua.
Lua
95
star
7

slua

Static lua compiler - Compile Lua code into C code.
C
67
star
8

nixio

System, Networking and I/O library for Lua. This is an unoffical fork of NIXO from: http://luci.subsignal.org/
C
58
star
9

mmap_lowmem

mmap() wrapper to expand MAP_32BIT to use all of the low 4Gbytes of address space.
C
35
star
10

lua-nanomsg

Lua bindings to NanoMsg
Lua
32
star
11

lua-epoll

Lightweight wrapper for epoll.
C
20
star
12

s1vm

Fast Wasm interpreter in Rust
Rust
18
star
13

bevy_shader_graph

Shader graph for Bevy
Rust
18
star
14

lua-clang-cindex

FFI bindings to libclang's CIndex interface.
Lua
12
star
15

websocket-client-go

Reconnecting Websocket Client Golang Library
Go
12
star
16

lua-llnet

A low-level network IO library.
C
12
star
17

luagit2

LuaGit2 has move to a new home at https://github.com/libgit2/luagit2
Lua
10
star
18

lua-buf

Mutable buffer object for Lua.
C
10
star
19

lua-http-tokenizer

A HTTP protocol tokenizer
C
8
star
20

node_engine

Rust
8
star
21

lludp_dissector

Wireshark dissector for the LLUDP protocol
Lua
6
star
22

jpeg2k

Safe wrapper for openjpeg-sys.
Rust
5
star
23

luaxcb

Lua bindings for XCB
C
4
star
24

bevy_fake_interior

Fake interior material for Bevy
Rust
4
star
25

nft_trader

NFT trader for Polymesh
TypeScript
4
star
26

serialization-benchmarks

Benchmark comparison of C/C++ serialization systems.
C
3
star
27

cr-sys

Rust raw bindings for cr.h: A Simple C Hot Reload Header-only Library
Rust
2
star
28

lua-net-bench

Network service benchmark/stress-testing suite written in Lua.
Lua
2
star
29

mongrel2_stream_prototype

Prototype a stream interface between mongrel2 and backend handlers.
Lua
2
star
30

faxpp

Fast XML Pull Parser
C
2
star
31

sub-script

Scripting interface for substrate nodes.
Rust
2
star
32

cr-rs

Rust safe wrapper for cr.h: A Simple C Hot Reload Header-only Library
Rust
2
star
33

lua-http-message

Fast HTTP message parser for Lua.
Lua
2
star
34

n_closure

header-only C Closure library
C++
2
star
35

pusher-client-go

Pusher Client Go Library
Go
1
star
36

material_designer

Designer for working on Materials/Shaders for Bevy
Rust
1
star
37

openjp2

Rust port of OpenJpeg
C
1
star