← All projects
Project record1 mention
Originally shared on Hacker News

Spindle

Spindle is a multicore-by-design, eio-native web framework for OCaml 5 with a type-driven API that derives codecs, request validation, OpenAPI specs and frontend schemas (Zod and Melange). It includes an RFC-strict HTTP server, composable dependencies, WebSockets, SSE, primitives for building MCP servers, plus distributed tracing, OT-compatible metrics and logging; submitter-reported benchmarks show it running x2 faster than NestJS and x5 faster than FastAPI on a single core.

Last shared
01 / The problem

What it addresses

Keeping server and client contracts in sync without maintaining separate definitions.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Spindle

    Spindle is a multicore-by-design, eio-native web framework for OCaml 5 with a type-driven API that derives codecs, request validation, OpenAPI specs and frontend schemas (Zod and Melange). It includes an RFC-strict HTTP server, composable dependencies, WebSockets, SSE, primitives for building MCP servers, plus distributed tracing, OT-compatible metrics and logging; submitter-reported benchmarks show it running x2 faster than NestJS and x5 faster than FastAPI on a single core.

    Problem: Keeping server and client contracts in sync without maintaining separate definitions.

    Posted by @zaiev · Original source ↗

    Story title · @zaiev · · Source ↗

    Show HN: Spindle – a full-featured, type-safe web framework for OCaml 5

    Submitted URL · @zaiev · · Source ↗

    https://github.com/hyphatech/spindle

    Source text · @zaiev · · Source ↗

    Spindle is a multicore-by-design, eio-native web framework for modern OCaml.

    Source text · @zaiev · · Source ↗

    Its central idea is to provide an expressive, type-driven API and derive the rest: codecs, request validation, OpenAPI spec and frontend schemas (Zod and Melange).

    Source text · @zaiev · · Source ↗

    This keeps contracts in sync between server and client without maintaining separate definitions.

    Source text · @zaiev · · Source ↗

    The framework includes an RFC-strict HTTP server, composable dependencies, WebSockets, SSE and high-level primitives for building MCP servers.

    Source text · @zaiev · · Source ↗

    It also provides production-ready essentials like distributed tracing, OT-compatible metrics, logging and other features you would expect.

    Source text · @zaiev · · Source ↗

    Speed was never the goal but the benchmarks show it running x2 faster than NestJS and x5 faster than FastAPI on a single core.

    Source text · @zaiev · · Source ↗

    Documentation: https://hyphatech.github.io/spindle/