All Projects → oskaritimperi → nimpb

oskaritimperi / nimpb

Licence: MIT License
Protocol Buffers for Nim

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to nimpb

ocaml-pb-plugin
A protoc plugin for generating OCaml code from protobuf (.proto) files.
Stars: ✭ 18 (-37.93%)
Mutual labels:  serialization, protobuf, protocol-buffers
protoc-plugin
A protoc compiler plugin for Clojure applications
Stars: ✭ 28 (-3.45%)
Mutual labels:  serialization, protobuf, protocol-buffers
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (+79.31%)
Mutual labels:  serialization, protobuf, protocol-buffers
Protobuf Java Format
Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
Stars: ✭ 134 (+362.07%)
Mutual labels:  serialization, protobuf, protocol-buffers
protobuf-d
Protocol Buffers Compiler Plugin and Support Library for D
Stars: ✭ 32 (+10.34%)
Mutual labels:  serialization, protobuf, protocol-buffers
Protobuf
A pure Elixir implementation of Google Protobuf
Stars: ✭ 442 (+1424.14%)
Mutual labels:  serialization, protobuf, protocol-buffers
elm-protobuf
protobuf plugin for elm
Stars: ✭ 93 (+220.69%)
Mutual labels:  serialization, protobuf, protocol-buffers
Protobuf Nim
Protobuf implementation in pure Nim that leverages the power of the macro system to not depend on any external tools
Stars: ✭ 90 (+210.34%)
Mutual labels:  serialization, protobuf, protocol-buffers
Protobuf
Protocol Buffers - Google's data interchange format
Stars: ✭ 52,305 (+180262.07%)
Mutual labels:  serialization, protobuf, protocol-buffers
javascript-serialization-benchmark
Comparison and benchmark of JavaScript serialization libraries (Protocol Buffer, Avro, BSON, etc.)
Stars: ✭ 54 (+86.21%)
Mutual labels:  serialization, protobuf, protocol-buffers
protobuf-ipc-example
Protocol buffer IPC example
Stars: ✭ 19 (-34.48%)
Mutual labels:  protobuf, protocol-buffers
protobuf-example-java
Companion Repository for my Protocol Buffers course
Stars: ✭ 67 (+131.03%)
Mutual labels:  protobuf, protocol-buffers
ProtobufDecoder
A Google Protocol Buffers (Protobuf) payload decoder/analyzer
Stars: ✭ 33 (+13.79%)
Mutual labels:  protobuf, protocol-buffers
protoconfig
ProtoConfig 1.0: Open Standard for using, defining, and consuming software configuration input in a unified way.
Stars: ✭ 24 (-17.24%)
Mutual labels:  protobuf, protocol-buffers
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-10.34%)
Mutual labels:  protobuf, protocol-buffers
protobuf-ts
Protobuf and RPC for TypeScript
Stars: ✭ 527 (+1717.24%)
Mutual labels:  protobuf, protocol-buffers
makego
Makefile setup for our Golang projects.
Stars: ✭ 65 (+124.14%)
Mutual labels:  protobuf, protocol-buffers
protodoc
protodoc generates Protocol Buffer documentation.
Stars: ✭ 43 (+48.28%)
Mutual labels:  protobuf, protocol-buffers
goprotoc
Library for writing protoc plugins in Go; also includes a pure-Go protoc replacement
Stars: ✭ 73 (+151.72%)
Mutual labels:  protobuf, protocol-buffers
grpc-chat
Simple Chat Server/Client implemented with gRPC
Stars: ✭ 107 (+268.97%)
Mutual labels:  protobuf, protocol-buffers

Protocol Buffers for Nim

Build Status

A Nim library to serialize/deserialize Protocol Buffers.

To actually generate Nim code from protobuf definitions, you need the protoc tool. To make things simple, nimpb depends on nimpb_protoc, which bundles protoc binaries for the most common platforms (Windows, Linux, macOS).

NOTE At the moment this is at a very rough state. Do not use for any kind of production use. Anything can change at any time. You've been warned.

Example

Given the following file:

syntax = "proto3";

message Test1 {
    int32 a = 1;

    enum MyEnum {
        Foo = 0;
        Bar = 1;
    }

    MyEnum e = 2;
}

You can use nimpb_build (a tool that comes with nimpb) to generate code like this (procs not included in the example):

type
    Test1_MyEnum* {.pure.} = enum
        Foo = 0
        Bar = 1

    Test1* = ref Test1Obj
    Test1Obj* = object of RootObj
        a: int32
        e: MyEnum

And you can use the generated code like this:

let message = newTest1()
message.a = 150
message.e = Test1_MyEnum.Bar

let data = serialize(message)

let message2 = newTest1(data)

assert message2.a == 150
assert message2.e == Test1_MyEnum.Bar

Other libraries

If you do not want to depend on the protoc compiler, check Peter Munch-Ellingsen's protobuf library. It handles parsing of the protobuf files in compile time which can make building simpler.

Services

For an example about how to generate services, see nimtwirp.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].