Show HN: Cap'n-rs – Rust implementation of Cloudflare's Cap'n Web protocol

Hacker News (score: 23)
Found: September 30, 2025
ID: 1619

Description

Other
Show HN: Cap'n-rs – Rust implementation of Cloudflare's Cap'n Web protocol Last week Cloudflare released Cap'n Web [1], a schema-free capability-based RPC protocol. I built capn-rs this week - a Rust implementation with full wire protocol compatibility. Links:

GitHub: https://github.com/currentspace/capn-rs Crates: https://crates.io/crates/capnweb-server API docs: https://docs.rs/capnweb-server

What's working:

Wire compatibility verified via integration tests against TypeScript reference Multi-transport: HTTP batch, WebSocket, WebTransport (HTTP/3) Complete IL (intermediate language) expression evaluator Promise pipelining with dependency resolution Comprehensive test coverage

The interesting design challenge was mapping Cap'n Web's record-replay .map() semantics to Rust's type system while maintaining ergonomic APIs. Cap'n Web records operations on placeholder values to build execution plans - in Rust this became a clean builder pattern with type-level guarantees. Built this as an experiment with Claude Code for porting complex protocols. The AI handled mechanical translation well, but architectural decisions (especially around async/await patterns and lifetime management) required human judgment. This is early days - I'd especially appreciate feedback on API ergonomics and any edge cases I might have missed. Also happy to discuss the protocol design or the AI-assisted development experience.

[1] https://news.ycombinator.com/item?id=45332883

More from Hacker

Show HN: Feather – a fresh Tcl reimplementation (WASM, Go)

Show HN: Feather – a fresh Tcl reimplementation (WASM, Go) Hey HN!<p>First time showing something here, but I&#x27;ve been furiously working over the holidays on Feather, a from scratch reimplementation of TCL designed for embedding in modern applications.<p>It&#x27;s starting out as a faithful reimplementation of TCL <i>without</i> I&#x2F;O, OOP features, or coroutines.<p>TCL has a special place in my heart because the syntax is so elegant for interactive use, and defining domain specific languages.<p>My motiviation is twofold: faster feedback loops for AI, and moldable software for users.<p>It turns out giving AI agents access to the runtime state of your program makes for really fast feedback loops, but embedding existing options in a world where shipping binaries for each platform is commonplace is tricky.<p>Embedding the real TCL is tricky because it comes with its own event loop (in 2025 you alreay have one), a GUI framework (you have a web framework already, or develop on mobile), and has access to the filesystem (don&#x27;t forget to delete all commands with file system access!).<p>Feather just doesn&#x27;t ship with those - expose only what you need from your application.<p>A WASM build comes out of the box and clocks in at ~120kb plus 70kb for connecting it to the browser or node.js.<p>And if embedding becomes easy, you can put a REPL everywhere: in mobile apps, in desktop software, as a control plane into web servers.<p>I want to imagine a world where all software is scriptable just like Emacs and nvim, with agents doing the actual work.

Comptime – C# meta-programming with compile-time code generation and evaluation

Comptime – C# meta-programming with compile-time code generation and evaluation

VS Code deactivates IntelliCode in favor of the paid Copilot

VS Code deactivates IntelliCode in favor of the paid Copilot

Fate: A modern data client for React and tRPC

Fate: A modern data client for React and tRPC

No other tools from this source yet.