gRPC over HTTP/2 in pure OCaml
0

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 79.1%
C 8.9%
Go 3.7%
C++ 1.4%
Shell 1.2%
Dune 0.9%
Roff 0.3%
Other 4.6%
94 1 0

Clone this repository

https://git.vm.fail/gazagnaire.org/ocaml-grpc https://git.vm.fail/did:plc:uguwwdx4kfqqeumjdtunzcih
ssh://git@git.recoil.org:2222/gazagnaire.org/ocaml-grpc ssh://git@git.recoil.org:2222/did:plc:uguwwdx4kfqqeumjdtunzcih

For self-hosted knots, clone URLs may differ based on your setup.


README.md

nox-grpc#

gRPC over HTTP/2, in pure OCaml, with an I/O-free core.

nox-grpc implements the gRPC wire protocol as an I/O-free state machine: bytes and state in, bytes and events out, no sockets of its own. The same core runs under Eio (via nox-grpc-eio), in dune test, and in fuzz harnesses. Messages are carried with nox-protobuf and the transport is nox-h2.

Installation#

Install with opam:

$ opam install nox-grpc

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install nox-grpc

Status#

Early. The protocol foundation is in place and tested; the transport-coupled layers are landing on top.

Layer Module State
Status codes Grpc.Status done
Message framing (length-prefixed) Grpc.Message done
Compression algorithms (grpc-encoding) Grpc.Compression names done; gzip/deflate via bytesrw next
Call metadata / trailers Grpc.Metadata next
Message serialization (protobuf) Grpc.Codec next
Method / service descriptors Grpc.Method next
Client / server state machines Grpc.Client / Grpc.Server next
Eio adapter (multicore server, client) nox-grpc-eio next

Design#

The library follows the project's protocol-library pattern: a pure core with the framing layer (Message), the serialization layer (Codec), and the per-side state machines (Client / Server), plus a thin Eio adapter that only shuttles bytes between a flow and the core. The server adapter targets multicore throughput with an Eio.Executor_pool over the nox-h2-eio server loop, in the manner of respond.

References#