Hacker News new | ask | show | jobs
by parabx 2838 days ago
Hi, lifelong python developer here. Is OCaml a good fit to do REST application servers? I've took a look a year ago but couldn't find well maintained libraries and it seems that the community is not so focused in general development. Am I wrong? OCaml seems really nice, I've been dabbling with rust for a while, and it feels great working with it but I'd like to try some purer functional languages too. My needs are basically a web container, some way to interface with SQL (ORM or a query builder, with support to PostGIS), some redis, some elasticsearch, nothing too fancy.
3 comments

Not particularly imo, no.

A great (albeit maybe not as great as OCaml ;) alternative for web usage would be F# with .NET Core, which has become a joy to work with over the past year or so on macos.

You could look at these:

https://github.com/rgrinberg/opium https://github.com/inhabitedtype/ocaml-webmachine https://github.com/inhabitedtype/ocaml-session https://github.com/arenadotio/pgx (there are a few other as well, not sure which one would support PostGIS) https://github.com/Leonidas-from-XIV/slacko

When in doubt head over to https://discuss.ocaml.org/ and show an example if you run into any trouble.

You can look at https://ocsigen.org and more particularly at https://ocsigen.org/tuto/6.2/manual/rest .