Rustly typed APIs; ... JSON RPC with Rust, Procedural macros and a DSL
summary
Procedural macros parse a custom DSL to generate JSON‑RPC client and server Rust code: typed traits, authorization checks, OpenRPC schemas and a Tower middleware stack; the generator is a few thousand lines of parser and codegen but produces a client proxy that compiles to WebAssembly so front end and back end share the same types, enabling compile‑time type safety and an in‑process Oxide test client that caught a real cancellation bug.
AI-written summary · about
chapters (14)
- 0:00Rust procedural macros intro
- 2:18What are procedural macros
- 7:20JSON RPC protocol basics
- 9:52Custom DSL for APIs
- 12:47API definition language design
- 15:42DSL to Rust code transform
- 18:53Compile-time API safety
- 21:42Typed client proxies
- 23:27Testing with in-memory HTTP
- 25:13Extending DSL to REST
- 26:37Type-safe frontend with WASM
- 28:27Macros pros and cons
- 30:10Macro complexity costs
- 30:52Q&A
related talks
28mGenerating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde
29mMacromancy: an introduction to Rust macros
24mGenerating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde
16mSafe, Fast, and Scalable: Why gRPC-Rust Should Be Your Next RPC Framework
33mDeclarative programming in Rust
02mOxidize Lightning Talks – Drew Ridley
25mWTF, Rust for Web Development??
28mRust Irgendwie, Irgendwo, Irgendwann
