Over 2025 we migrated the whole Ocsigen stack (ocsigenserver, Eliom, ocsigen-toolkit, ocsigen-start) from Lwt to Eio. The migration compiles and the test suite passes. We have nonetheless decided not to release it and to stay on Lwt for now, and we wrote up why.
Two obstacles stopped us:
- Loss of function coloring. Under Lwt, a
_ Lwt.tin a type tells you a call may suspend or do I/O. In a multi-tier framework like Eliom this is crucial: the same shared expression can be a local call on the server and a network round-trip on the client. Without coloring, nothing at the call site tells you where to put a spinner, and reactive combinators (React/map_s) silently lose the guarantee that they are pure. - Eio’s handler model vs browser events. On the client, DOM event handlers are called directly by the browser with no Eio handler on the stack, so any
performcrashes. The usual workaround (Eio_js.start) defers the body viasetTimeout(0), which runs after event propagation and breakspreventDefault/stopPropagation.
This is not an anti-Eio post. Effects are a major achievement of OCaml 5 and we are grateful to the multicore team. We also think the monadic style is genuinely fine (with let* it is comfortable to write), and Lwt_direct is there for those who dislike monads.
Our real worry is unity. Migrating a very large codebase is genuinely hard, and the less well-funded projects on Lwt simply cannot afford it. More broadly, the state of concurrency libraries in OCaml is, in our view, extremely concerning: the community is small and cannot afford a split. If OCaml is to grow it must reach real-world applications, and those users need high-level, interoperable building blocks. Ocsigen has always aimed to provide such tools while fostering the unity of the ecosystem, and we are fully committed to helping solve the problem of concurrency libraries. We would welcome your view on directions that could unblock us, including improving Lwt itself (io_uring, effects, multicore).
Full write-up: Why Ocsigen decided not to switch from Lwt to Eio (for now) — Ocsigen
Feedback, ideas and constructive disagreement very welcome.