Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been getting lots of ads about IHP on reddit lately. The ads are really bad, which led me to believe IHP would be of equally bad quality, but looking at IHP homepage now I'll just have to try it out sometime. Now, I have some questions. As a user, why should I use IHP instead of Yesod or Servant? Can I create rest and especially graphql apis or is it more focused on building old-school server side rendered pages?


Thanks for the feedback on the ads! We've been experimenting a lot with different ad formats recently. I'll make sure this is fixed. (Update: Fixed now, thanks again for the honest feedback)

In a comparison between IHP and Yesod I think that IHP is designed for people that have only very little to no haskell experience. IHP brings a lot of conventions and code generators to get you up and running very quickly, while Yesod gives you more flexibility (flexibility might be more challenging when you're just starting out with haskell. E.g. what DB library do you want to pick? In Yesod you have many options, in IHP we'll provide one out of the box). Check out the IHP documentation and compare it to the Yesod docs, you'll quickly see the difference :) Also if you want to check out some reviews of people already using IHP, you can find a few longer ones on our G2 page https://www.g2.com/products/ihp/reviews

> Can I create rest and especially graphql apis or is it more focused on building old-school server side rendered pages?

At the start IHP was focussed a lot on server-side rendering. Now you can also use it for building REST APIs. GraphQL is not yet supported, but it's coming in the future.

We're also right now working on a generic REST API layer with a bundled JS SDK. It will allow you to query your database, create and delete models and keep everything in sync with a realtime sync engine.

Here's a JS code example:

        const tasks = await query('tasks')
            .orderBy('createdAt')
            .fetch()
On the backend we use Postgres Row-level-security Policies to make sure that a user can only access his own data.

Here's a demo react component that uses the new JS APIs: https://github.com/digitallyinduced/ihp-datasync-demo/blob/m...

Docs are still in progress, but here's a draft https://github.com/digitallyinduced/ihp/commit/39baa4aa23cc6... :)


To me, IHP provides so many great features for making type-safe robust web apps, I have forgotten about GraphQL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: