Hi everyone, I’m currently developing a web application that runs Elm client side and Python (Flask) on the server. I’ve been using type hints and an algebraic data type module in Python to try and maintain some of the type safety that I have in Elm, but it’s getting a bit ridiculous now and is a bit of a burden to maintain. I’ve decided that I should just make the leap and move the back end over to Haskell. There are a lot of choices for libraries, so I was hoping that people might be able to point me in the right direction.
If anyone has any advice on the following, it’d be very much appreciated:
A library for managing WebSockets.
A GraphQL library.
A database ORM, or some sort of persistence, it’s early enough in the project that I can change this. I’m currently using SQLAlchemy with SQLite. I’d prefer not to write SQL queries by hand.
Also any more general comments about using Haskell with Elm would be welcome too!
I did have FastAPI recommended to me a while back, but it seems to have come on a lot since then. Thanks, I’ll take a look at that.
I haven’t looked at RWAs for Haskell back ends, although those are the three frameworks that I’ve spent most time looking at. I found Scotty to be the easiest to work with, but it’s difficult to envisage how these things scale. Hopefully RWAs will give me a bit of insight into that!
Thanks for you suggestions, they’re much appreciated!
I cannot recommend libraries for Haskell backends from production experience, but I spent a bit time the last weeks figuring the same thing out for me.
For me the most interesting web framework seems to be servant since it has great docs and seems to be rather complete for API development. It is also a nice gimmick that it can automatically generate Elm decoder / encoder for your API.
For the database I tried out HDBC and yeshql, since I need access to a weird database through odbc with a custom SQL dialect. I think I remember hearing good things about https://hackage.haskell.org/package/hasql when you’re using postgresql… Although these options are not ORMs.
Since I probably wouldn’t use GraphQL with servant, I haven’t explored this, but https://morpheusgraphql.com/ looks really interesting, just in case you haven’t seen it yet.