# Spindle - Type-safe web framework for modern OCaml 5

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

> Hacker News story 50377613 · language: en · submitted 2026-11-05
> Web version: https://zeli.app/story/50377613
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 62 · by [zaiev](<https://news.ycombinator.com/user?id=zaiev>) · 💬 9
[original](<https://github.com/hyphatech/spindle>) · [HN discussion](<https://news.ycombinator.com/item?id=50377613>)

## Summary

Spindle is a full-featured web framework built for OCaml 5, bringing type safety to every layer of server development. It generates OpenAPI specs, Zod-style validation, and typed clients directly from your route definitions, so your server, native client, and Melange-compiled frontend can never disagree about paths or data shapes. Beyond REST, it covers WebSockets, server-sent streams, MCP resources with live subscriptions, OAuth 2.0 bearer token verification, and HTTP over Unix sockets. If you've wanted OCaml's rigor without hand-writing boilerplate, Spindle lets you define routes once and get everything else for free.

## Key quote

> Spindle gains a third printer from the walk OpenAPI and Zod read, so the three cannot disagree: wiretype's module for every shape, a component named for the route, and a function per route over the browser's fetch.

## HN discussion (9 comments)

### [avsm](<https://news.ycombinator.com/item?id=50405702>)

> Nice work! Just looking through the Eio code, you may want to use the capability restrictions more. For example, in the static file serving code, you can use `Eio.Path.open_subtree` which will use Linux fd sandboxing to prevent accidental symlink escapes or other ways to leave that subtree: https://ocaml-multicore.github.io/eio/eio/Eio/Path/index.htm...

### [B4uler5](<https://news.ycombinator.com/item?id=50405538>)

> Will keep an eye on this project, love me some Ocaml! Do you have an example of it deployed and in use?
>
> Don’t like the “fresh off the AI block” feeling of the website but could be a bit more confident if I could see it used in the actual wild!

### [andsoitis](<https://news.ycombinator.com/item?id=50404701>)

> Cool to see some Lisp in this OCaml project:
>
> Add to your bin/dune:
>
> (executable
>
> (name main)
>
> (libraries spindle eio_main)
>
> (preprocess (pps ppx_wiretype)))**

---

## Cite

- Page: https://zeli.app/story/50377613
- Date: 2026-11-05
- Source: github.com (https://github.com/hyphatech/spindle)
- Hacker News: https://news.ycombinator.com/item?id=50377613

## Other languages

- zh: https://zeli.app/zh/story/50377613 · markdown: https://zeli.app/zh/story/50377613.md
- ja: https://zeli.app/ja/story/50377613 · markdown: https://zeli.app/ja/story/50377613.md
- ko: https://zeli.app/ko/story/50377613 · markdown: https://zeli.app/ko/story/50377613.md
- de: https://zeli.app/de/story/50377613 · markdown: https://zeli.app/de/story/50377613.md
- es: https://zeli.app/es/story/50377613 · markdown: https://zeli.app/es/story/50377613.md
- ru: https://zeli.app/ru/story/50377613 · markdown: https://zeli.app/ru/story/50377613.md
