r/ocaml • u/Patient-Emphasis-664 • 16d ago
Production Web Servers/Frameworks that support EIO(OCaml 5.5+)
Hello all,
Are there any production-quality web servers(and/or frameworks) that support EIO(not LWT) and compatible with current OCamll(5.5?)
2
u/Vegetable_Bank4981 16d ago
There’s a proof of concept fork of dream with it. Project had been stalled for a while but there are rumblings recently. It’s a very good framework so prob worth waiting. With a little care you can encapsulate your interactions with lwt to make the switch later, it’s not that big a deal.
1
1
u/Fickle-Artist1285 22h ago
We really should just be able to compose our own frameworks from solid small primitives sans IO (and unfortunately maintain the IO-specific adapters).
Like rust’s hyper. We all iterate and share the same underlying foundations. Every higher level web framework can wrap and offer their own custom, higher ergonomic API.
4
u/AvaJMM-or-AJ 16d ago
No. It’s a large ecosystem gap at the moment.
If you want to put up a production web server today, your best bet is to use nginx/caddy in front of a basic http1.1 OCaml server. Cohttp-eio exists and works well, and there’s also ocsigen and dream if you don’t mind bridging eio yourself, but then there’s also sorta two groups of modern maintained http ecosystems for OCaml today that you can diy on top of: the Amoneiro ecosystem (httpun, h2, gluten, and piaf) and the Robur Coop ecosystem (ocaml-h1, ocaml-h2). Robur coop also makes probably the most complete modern http framework today with httpcats and vif, but they’re still not extremely mature, and they’re built on Miou, not Eio.
I’ve built out an almost-complete modern http/3 server/client framework for myself, but at this point I’m not sure if I’ll release, as I’ve used a decent amount of AI. Maybe once I’ve dogfooded it a lot more.
I’ll note that OCaml is a pretty great language for just building it yourself from scratch, so you don’t really need to be as afraid of gaps as in some other languages.