Spindle is a full-featured, type-safe web framework for OCaml 5. Built by Hypha Technologies Ltd., it is multicore-by-design and eio-native, offering an RFC-strict HTTP server, composable dependencies, WebSockets, SSE, and high-level primitives for building MCP servers. It aims to be fast, ergonomic, and strictly compliant with HTTP standards.
Its central idea is an expressive, type-driven API that derives codecs, request validation, OpenAPI specs, and frontend schemas (Zod and Melange) directly from OCaml types. This keeps server and client contracts in sync without maintaining separate definitions. Interactive docs are generated via Scalar from your routes.
Speed was never the goal, but benchmarks show it running x2 faster than NestJS and x5 faster than FastAPI on a single core. The framework includes SQLite and Postgres support, sessions, logging, distributed tracing, and OT-compatible metrics. It is licensed under MIT.
Install via opam and add spindle to your dune file. Documentation is available at hyphatech.github.io/spindle/.
Source: Hacker News · Summarized by HeadlinesBriefing