rrpc
rrpc is a simple codegen tool for creating RPC APIs from a defined schema. It does not aim to create a new protocol. rrpc generates boilerplate code from a defined schema. It's like sqlc for APIs. Currently it supports generating a go or python server and clients for go, python and typescript.
Motivation
The industry standard for communication between services is gRPC. It may be good for Google-scale services, but has several disadvantages:
- Official protobuf compiler generates Python code without type annotations
- It is bloated
- HTTP/2 may introduce bugs of its own
- Binary protocol is harder to debug
For small and medium-sized projects the performance and industrial adoption of the gRPC toolkit may not outweigh these problems.
Features
This project aims to provide a simple tool with the following properties:
- Server code generation in go or python
- Client generation for go, python and typescript
- Type validation in python using pydantic (with
--py-pydantic flag)
- Type validation in typescript using zod (with
--ts-zod flag)
- Simple JSON over HTTP protocol
- Single portable binary
- OpenAPI schema generation
- Generated code is human readable
Schema language
Schema is defined in rrpc schema language
model GreetingMessage {
message: string
}
rpc HelloWorld(
name: string,
surname: string?,
) GreetingMessage
View vs code extension for syntax highlighting.
Language support
| Language |
Server |
Client |
| Go |
✅ |
✅ |
| Python |
✅ |
✅ |
| Typescript |
❌ |
✅ |
Other languages can be supported via OpenAPI toolkits.
Installation
go install github.com/Rapid-Vision/rrpc
Docs
Usage examples
See examples/ directory for server, client and Makefile implemenation examples. Also integration_test/ may be useful as reference too.
Comparison & Fit
This project focuses on a small, typed, JSON-over-HTTP RPC flow.
- gRPC: gRPC is a full-featured RPC system with strong tooling, streaming, and HTTP/2. rrpc is lighter and simpler but lacks streaming, interceptors, and a mature ecosystem.
- OpenAPI: OpenAPI is an API description format with broad tooling for REST-style endpoints. rrpc is RPC-oriented and does not target REST semantics or multiple transports.
- GraphQL: GraphQL offers flexible client queries and a rich type system. rrpc is schema-first but request/response shapes are fixed per method and not queryable.
- CUE: CUE is a general configuration and validation language. rrpc is narrowly scoped to RPC schema + codegen rather than validation or policy.
- TypeSpec: TypeSpec is a rich API modeling language with multiple emitters. rrpc is smaller, has a simpler DSL, and targets a limited set of generators.
When this may be useful
- You want a small schema language and minimal runtime.
- You want strict typing with simple JSON over HTTP.
When this is not a good fit
- You need streaming, bidirectional RPC, or advanced middleware.
- You need multi-language support beyond Go/Python/TypeScript.
- You want REST or GraphQL semantics and tooling.