Hello! I am a newcomer to the OCaml community, and this is my first post.
I would like to share an experimental web framework I have been working on, based on Eio. I am a happy user of Dream and Opium, but I felt there was still room for improvement.
I would love to hear your suggestions and opinions regarding the API. What important features do you feel are missing in existing libraries? Personally, I miss the type-safe routing that Servant offers, as well as the Phoenix real-time API.
Its the ocaml web framework with the most features that I know. It has not only type safe routing, but type safe http requests.
That is, you can mark a function as being an endpoint of sorts, and then when this function is called from the frontend, the http request for it is generated, and the function actually runs on the backend.
I believe you are referring to Ocsigen Eliom. I did look into it, but it is built on Lwt, and I was specifically interested in a framework that does not use Lwt and use algebraic effects instead. This is not due to any dislike for Lwt, but rather my desire to explore what an OCaml web framework built with Eio and algebraic effects might look like.
Eliom’s server-client capabilities are interesting, but they are incompatible with our existing tooling. Our teams prefer using Melange with React.js (via reason-react) for the frontend and server-reason-react for the backend
Yes, ocsigen/eliom is opiniated, and you have to kind of opt in everything to get the benefits.
However, even if you can’t use it, looking at it to get inspiration for features for your framework is certainly worth it.
I am not a big fan of melange, because of how much more complicated it is to use random libs from opam compared to jsoo. My understanding is that it makes a lot of sense if you have an existing JS codebase or if you want to use JS tooling.
Btw, your type safe routes are something very nice. Did you get inspiration from furl ?
I think your api looks nicer, but the idea is the same.
This is currently what we offer through our Vif framework. The latter also uses algebraic effects and Miou as a scheduler (you can find more details here). We have wanted typed routes for a very long time. vif goes a little further than furl because it also attempts to type the content of a request (and recognises whether this content is JSON or multipart/form-data, which allows for typed forms). There is a tutorial available here and an example of a chat room (with websockets) here.