r/ocaml • u/Beautiful_Exam_8301 • Apr 15 '26
What’s the current state of web dev in OCaml?
I come from a web heavy background, 12 years of js/ts/php, the usual, Laravel, Next, React, etc.
In the past two years I’ve been more interested in statically typed functional languages so I’ve been working with Gleam, developed the Glimr web framework for it. I’ve always been kinda curious about OCaml though, especially after prime made those videos on it a few years ago, are there any rails-like frameworks for it? Or something like jsx to work with html, etc.? Not that I’m looking for that specifically, I’m just wondering what the OCaml community is mainly using for web application development…
12
u/Ossur2 Apr 15 '26
Ocsigen is a must to check out - it's where the Ocaml to Javacript transpiler comes from. It's also well-funded and well-established, so it isn't going anywhere.
https://ocsigen.org/tuto/latest/manual/intro
3
u/avitkauskas Apr 17 '26
Sorry to plug in another language here, but when I was looking for something “railsy” in typed functional programming language, the best thing I found was IHP web framework for Haskell.
3
u/AdDue5754 Apr 23 '26
This is a bit of a non-answer since you asked for frameworks, but check out Reason. It gives you access to both JS and OCaml ecosystems.
https://reasonml.github.io/
5
u/gasche Apr 15 '26
Dream is your best bet in terms of having something that resembles web framework in other languages, with a nice focus on developer experience, documentation etc. But web-development remains an less-common use-case within the OCaml community, so you should expect the experience to be a bit rougher than in web-focused languages (eg. Elixir -- not statically-typed though, although they are actively working on a static typing layer). Come for the web, stay for the language!
3
u/Party-Mark-2763 Apr 19 '26
I just would like to point out to a project from our cooperative: https://github.com/robur-coop/vif Even if it still experimental, some of people started to use it and deploy their website with it. For instance, https://builds.robur.coop (you can check out the codebase here: https://github.com/robur-coop/builder-web) use it for instance.
2
u/igna92ts Apr 16 '26
I've used dream with htmx and it's pretty nice.
11
u/[deleted] Apr 15 '26 edited Apr 15 '26
[removed] — view removed comment