restruct VS gRPC

Compare restruct vs gRPC and see what are their differences.

restruct

Rich binary (de)serialization library for Golang (by go-restruct)

gRPC

The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) (by grpc)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
restruct gRPC
3 201
345 40,775
0.0% 0.6%
3.2 9.9
about 2 years ago 5 days ago
Go C++
ISC License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

restruct

Posts with mentions or reviews of restruct. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-03-25.
  • Why isn't there a Swagger/OpenAPI for binary formats?
    13 projects | news.ycombinator.com | 25 Mar 2022
    My project Restruct[1] does Kaitai-like things but also supports serialization. Unfortunately, it only supports Go and only deals with Go struct tags rather than YAML manifests. Still, it totally can be used for serialization. I use it to sketch out quick projects against arbitrary binary formats. Two examples: one, parsing PNG headers to implement a quick binwalk-like program for just PNG that looks for the IEND chunk to extract accurately[2], two, a program that splits FL Studio FLP projects by playlist track[3].

    I feel like I’ve self-promoted Restruct like four times on Hacker News, and I feel kind of bad because it could use improvements and even some bug fixes and I never seem to get around to it. Oh well. It’s still useful for me, I hope it’s useful for others, too.

    That said, Kaitai has a fairly clear path towards adding serialization from a design PoV; many things that would be calculated for parsing structures in deserialization could just become checks/assertions in serialization. As an example, checking that an expression calculates out to the expected value would be a reasonable approach. Reversible expressions could be implemented for some cases, too, if you want it to do more of the heavy lifting. I think the biggest obstacle is actually implementing it, and frankly my Scala is too weak to help with such a relatively big undertaking.

    I’ve also played with the rust nom library, which implements functional programming style parser combinators. It is quite cool how it can express fairly complex grammars and binary formats pretty much equally well, albeit optimizing it effectively requires serious magic that I do not think nom has. (I assume in Haskell, the same thing can be done with mind-boggling optimization power.)

    [1]: https://github.com/go-restruct/restruct

    [2]: https://github.com/jchv/pngextract

    [3]: https://github.com/jchv/flsplit

  • Kaitai Struct: A new way to develop parsers for binary structures
    12 projects | news.ycombinator.com | 17 Mar 2022
    I’m a big fan of Kaitai Struct, to the point where I’ve even contributed a small bit of improvements to its Go support, and I use it in a handful of small projects. It’s indispensable for spelunking blobs of binary data.

    I’ve also taken some inspiration with a Go library I wrote, restruct:

    https://github.com/go-restruct/restruct

    … which is a bit like Go’s JSON encoding/decoding library, but with kaitai-like annotations for binary encoding. (Check the PNG example to see some of what can be done with it.)

  • Plain Text Protocols
    4 projects | news.ycombinator.com | 25 Feb 2021
    Honestly, I dislike plaintext formats a lot. It is more accessible because it’s human readable. But, this only extends to humans who happen to speak the language the protocol uses for keywords. While it’s not a huge ask, I still suggest this is mostly not that interesting of a benefit.

    Parsing and emitting plaintext formats, meanwhile, is a rabbit hole. It’s human readable which makes you tempted to make it human writable. Should you accept extraneous whitespace? Tabs vs spaces? Terminating new line? Unix or DOS line endings? Etc.

    Binary data may seem less accessible, but I blame the libraries. There’s tons of easy ways to parse text. You can use string.split, atoi and scanf in your language of choice. What is there for binary?

    In Go, the encoding/binary package actually implements something really cool. A simple reflection-based mechanism that can read and write binary data into a structure in a defined and simple way.

    lunixbochs extended this to struc[1], which adds additional tags for advanced reading and writing of binary structures, including variable length structures. I went further and maybe a bit off into the deep end with Restruct[2], a similar concept but with a lot more features, designed specifically so I could handle advanced structures quickly.

    The end result is that I can define some Go structs with integers, strings, byte arrays and corresponding tags, and be able to serialize and deserialize from those structures to their corresponding binary representation. For an overdone demo of what you could do with Restruct for example, see this (incomplete) PNG demo: https://github.com/go-restruct/restruct/blob/master/formats/... (It is mainly incomplete because I had moved focus to develop a codegen for restruct, to improve runtime performance, although such work has since stalled.)

    [1]: https://pkg.go.dev/github.com/lunixbochs/struc

    [2]: https://pkg.go.dev/github.com/go-restruct/restruct

gRPC

Posts with mentions or reviews of gRPC. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-03.
  • Golang: out-of-box backpressure handling with gRPC, proven by a Grafana dashboard
    4 projects | dev.to | 3 Apr 2024
    gRPC, built on HTTP/2, inherently supports flow control. The server can push updates, but it must also respect flow control signals from the client, ensuring that it doesn't send data faster than what the client can handle.
  • Reverse Engineering Protobuf Definitions from Compiled Binaries
    5 projects | news.ycombinator.com | 9 Mar 2024
    Yes, grpc_cli tool uses essentially the same mechanism except implemented as a grpc service rather than as a stubby service. The basic principle of both is implementing the C++ proto library's DescriptorDatabase interface with cached recursive queries of (usually) the server's compiled in FileDescriptorProtos.

    See also https://github.com/grpc/grpc/blob/master/doc/server-reflecti...

    The primary difference between what grpc does and what stubby does is that grpc uses a stream to ensure that the reflection requests all go to the same server to avoid incompatible version skew and duplicate proto transmissions. With that said, in practice version skew is rarely a problem for grpc_cli style "issue a single RPC" usecases: even if requests do go to two or more different versions of a binary that might have incompatible proto graphs, it is very common for the request and response and RPC to all be in the same proto file so you only need to make one RPC in the first place unless you're using an extension mechanism like proto2 extensions or google.protobuf.Any.

  • Delving Deeper: Enriching Microservices with Golang with CloudWeGo
    7 projects | dev.to | 22 Feb 2024
    While gRPC and Apache Thrift have served the microservice architecture well, CloudWeGo's advanced features and performance metrics set it apart as a promising open source solution for the future.
  • gRPC Name Resolution & Load Balancing on Kubernetes: Everything you need to know (and probably a bit more)
    5 projects | dev.to | 6 Feb 2024
    The loadBalancingConfig is what we use in order to decide which policy to go for (round_robin in this case). This JSON representation is based on a protobuf message, then why does the name resolver returns it in the JSON format? The main reason is that loadBalancingConfig is a oneof field inside the proto message and so it can not contain values unknown to the gRPC if used in the proto format. The JSON representation does not have this requirement so we can use a custom loadBalancingConfig .
  • Dart on the Server: Exploring Server-Side Dart Technologies in 2024
    4 projects | dev.to | 30 Jan 2024
    The Dart implementation of gRPC which puts mobile and HTTP/2 first. It's built and maintained by the Dart team. gRPC is a high-performance RPC (remote procedure call) framework that is optimized for efficient data transfer.
  • Usando Spring Boot RestClient
    4 projects | dev.to | 30 Jan 2024
  • How to Build & Deploy Scalable Microservices with NodeJS, TypeScript and Docker || A Comprehesive Guide
    13 projects | dev.to | 25 Jan 2024
    gRPC is a high-performance, open-source RPC (Remote Procedure Call) framework initially developed by Google. It uses Protocol Buffers for serialization and supports bidirectional streaming.
  • Actual SSH over HTTPS
    9 projects | news.ycombinator.com | 23 Dec 2023
    In general, tunneling through HTTP2 turns out to be a great choice. There is a RPC protocol built on top of HTTP2: gRPC[1].

    This is because HTTP2 is great at exploiting a TCP connection to transmit and receive multiple data structures concurrently - multiplexing.

    There may not be a reason to use HTTP3 however, as QUIC already provides multiplexing.

    I expect that in the future most communications will be over encrypted HTTP2 and QUIC simply because middleware creators can not resist to discriminate.

    [1] <https://grpc.io>

  • Why gRPC is not natively supported by Browsers
    1 project | dev.to | 17 Dec 2023
    Even in the https://grpc.io blog says this
  • SGSG (Svelte + Go + SQLite + gRPC) - open source application
    5 projects | /r/sveltejs | 6 Dec 2023
    gRPC

What are some alternatives?

When comparing restruct and gRPC you can also consider the following projects:

Kaitai Struct - Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Nim / Perl / PHP / Python / Ruby

ZeroMQ - ZeroMQ core engine in C++, implements ZMTP/3.1

binrw - A Rust crate for helping parse and rebuild binary data using ✨macro magic✨.

Apache Thrift - Apache Thrift

cantordust - Public repository for Cantordust Ghidra plugin.

Cap'n Proto - Cap'n Proto serialization/RPC system - core tools and C++ library

kaitai-to-wireshark - Converts a Kaitai Struct file description to a Wireshark LUA plugin

zeroRPC - zerorpc for python

HTTP Parser - http request/response parser for c

rpclib - rpclib is a modern C++ msgpack-RPC server and client library

RecordFlux - Formal specification and generation of verifiable binary parsers, message generators and protocol state machines

nanomsg - nanomsg library